Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace timezone.utc with datetime.timezone.utc #246

Merged
merged 1 commit into from
Mar 20, 2023

Conversation

mschoettle
Copy link
Contributor

timezone.utc is deprecated and therefore the following RemovedInDjango50Warning is emitted during our tests:

ERROR    easyaudit.signals.model_signals:model_signals.py:125 easy audit had a pre-save exception.
Traceback (most recent call last):
  File "<snip>/.venv/lib/python3.10/site-packages/easyaudit/signals/model_signals.py", line 72, in pre_save
    delta = model_delta(old_model, instance)
  File "<snip>/.venv/lib/python3.10/site-packages/easyaudit/utils.py", line 57, in model_delta
    new_value = get_field_value(new_model, field)
  File "<snip>/.venv/lib/python3.10/site-packages/easyaudit/utils.py", line 28, in get_field_value
    value = timezone.make_naive(value, timezone=timezone.utc)
  File "<snip>/.venv/lib/python3.10/site-packages/django/utils/timezone.py", line 49, in __getattr__
    warnings.warn(
django.utils.deprecation.RemovedInDjango50Warning: The django.utils.timezone.utc alias is deprecated. Please update your code to use datetime.timezone.utc instead.

This PR replaces the use of timezone.utc with datetime.timezone.utc.

@jheld jheld merged commit fed129b into soynatan:master Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants