Skip to content

Commit

Permalink
feat: Remove todos (#905)
Browse files Browse the repository at this point in the history
## Describe your changes

Fixes: #

## Checklist before requesting review

- [x] Feature/fix PRs should add one atomic (as small as possible)
feature or fix.
- [x] The code compiles and all the tests pass.
  • Loading branch information
didrikmunther authored Aug 12, 2023
1 parent d99564c commit 7661a8f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 8 additions & 3 deletions register/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import os

from django.contrib.auth.models import User
from django.utils import timezone

from fair.models import Fair

is_dev = os.environ["DJANGO_SETTINGS_MODULE"] == "ais.local.settings"


def get_fair():
return Fair.objects.filter(year=timezone.now().year).first()
Expand All @@ -11,8 +15,9 @@ def get_fair():
def get_user(request):
user = request.user
if not user.is_authenticated:
# Todo: remove for prod
user = User.objects.filter(email="[email protected]").first()
# return None
if is_dev:
user = User.objects.filter(email="[email protected]").first()
else:
return None

return user
8 changes: 0 additions & 8 deletions register/api/registration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from django.views.decorators.csrf import csrf_exempt

from companies.models import Company, CompanyContact
from fair.models import RegistrationState
from exhibitors.models import Exhibitor
Expand Down Expand Up @@ -30,8 +28,6 @@ def render_company(request, company, contact, exhibitor):
return status.INVALID_REGISTRATION_PERIOD


# Todo: remove in prod
@csrf_exempt
def submit(request):
fair = get_fair()
period = fair.get_period()
Expand All @@ -52,8 +48,6 @@ def submit(request):
return submit_cr(request, company, fair, contact, exhibitor)


# Todo: remove in prod
@csrf_exempt
def index(request):
"""
Root endpoint for all information regarding the current complete registration
Expand All @@ -72,8 +66,6 @@ def index(request):
return render_company(request, company, contact, exhibitor)


# Todo: remove in prod
@csrf_exempt
def get_company(request, company_pk):
company = Company.objects.filter(pk=company_pk).first()
if not company:
Expand Down

0 comments on commit 7661a8f

Please sign in to comment.