Skip to content

Server error when USE_TZ = False #316

@sureshvv

Description

@sureshvv
  File "django42/lib/python3.8/site-packages/spirit/user/views.py", line 32, in update
    form = UserProfileForm(
  File "django42/lib/python3.8/site-packages/spirit/user/forms.py", line 103, in __init__
    now = timezone.localtime(timezone.now())
  File "django42/lib/python3.8/site-packages/django/utils/timezone.py", line 218, in localtime
    raise ValueError("localtime() cannot be applied to a naive datetime")

Exception Type: ValueError at /spirit/user/
Exception Value: localtime() cannot be applied to a naive datetime
Raised during: spirit.user.views.update

Changing forms.py line 103 to

now = timezone.now()

seems to have "fixed" it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions