-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 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
1 parent
d99564c
commit 7661a8f
Showing
2 changed files
with
8 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters