Skip to content

Commit

Permalink
Merge pull request #142 from opengisch/do_not_require_useraccount_tz
Browse files Browse the repository at this point in the history
Do not require user account for timezone settings
  • Loading branch information
suricactus authored Nov 3, 2021
2 parents fba51d9 + 88a05db commit c2d8288
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docker-app/qfieldcloud/core/middleware/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ def __init__(self, get_response):
self.get_response = get_response

def __call__(self, request):
if request.user.is_authenticated:
if request.user.is_authenticated and hasattr(
request.user.useraccount, "useraccount"
):
user_tz = request.user.useraccount.timezone
elif settings.TIME_ZONE:
user_tz = pytz.timezone(settings.TIME_ZONE)
Expand Down

0 comments on commit c2d8288

Please sign in to comment.