We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
imagine some field:
expires_at = fields.DateTimePGPSymmetricKeyField(null=True)
set equal to:
from datetime import timedelta from django.utils.timezone import now ... expires_at = now() + timedelta(seconds=token['expires_in'])
I noticed there was an issue when I got the error:
can't compare offset-naive and offset-aware datetimes
from this call on my model:
@property def is_expired(self): return self.expires_at < now()
Inspecting the unencrypted datetime next to a never encrypted datetime -- you can see the never encrypted datetime still has timezone information:
I can remedy this by refacroting my is_expired method to:
is_expired
import pytz ... @property def is_expired(self): return self.expires_at.replace(tzinfo=pytz.UTC) < now()
but I was curious if this was a defect.
Thanks for your time! :)
The text was updated successfully, but these errors were encountered:
This was fixed in #307 which is in master but not released on PyPi yet.
Sorry, something went wrong.
No branches or pull requests
imagine some field:
set equal to:
I noticed there was an issue when I got the error:
from this call on my model:
Inspecting the unencrypted datetime next to a never encrypted datetime -- you can see the never encrypted datetime still has timezone information:
I can remedy this by refacroting my
is_expired
method to:but I was curious if this was a defect.
Thanks for your time! :)
The text was updated successfully, but these errors were encountered: