Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/backend/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1405,7 +1405,7 @@ def resolve_app_activity_chart(root, info, app_id, period=TimeRange.DAY):
if not user_can_access_app(info.context.user.userId, app_id):
raise GraphQLError("You don't have access to this app")

end_date = datetime.now() # current time
end_date = timezone.now() # current time

# default values for period='day'
# 24 hours before current time
Expand Down
4 changes: 2 additions & 2 deletions backend/ee/licensing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ def activate_license(phase_license):
phase_license.signature_date, "%Y-%m-%d"
),
"issuing_authority": phase_license.issuing_authority,
"issued_at": datetime.now(),
"issued_at": timezone.now(),
"expires_at": phase_license.expires_at,
"activated_at": datetime.now(),
"activated_at": timezone.now(),
}

if phase_license.plan == PlanTier.PRO_PLAN.value:
Expand Down
3 changes: 2 additions & 1 deletion backend/ee/licensing/verifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from nacl import encoding, signing, exceptions
from .utils import PhaseLicense, parse_license_format
from datetime import datetime
from django.utils import timezone
import json

VERIFIER_KEYS = [
Expand Down Expand Up @@ -30,7 +31,7 @@ def verify_signature(public_key_hex, license_str):
data["issued_at"] = datetime.strptime(data["issued_at"], "%Y-%m-%d").date()
data["expires_at"] = datetime.strptime(data["expires_at"], "%Y-%m-%d").date()

if datetime.now().date() > data["expires_at"]:
if timezone.now().date() > data["expires_at"]:
print("License is expired.")
valid = False
else:
Expand Down
Loading