Skip to content

Commit

Permalink
Fix comparing offset-naive and offset-aware datetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev authored Nov 26, 2024
1 parent 86c07a6 commit 34a0671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions revolt/permissions_calculator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from datetime import datetime
from datetime import datetime, timezone
from typing import TYPE_CHECKING, cast

from revolt.enums import ChannelType
Expand Down Expand Up @@ -28,7 +28,7 @@ def calculate_permissions(member: Member, target: Server | Channel) -> Permissio
for role in member.roles:
permissions = (permissions | role.permissions._allow) & (~role.permissions._deny)

if member.current_timeout and member.current_timeout > datetime.now():
if member.current_timeout and member.current_timeout > datetime.now(timezone.utc):
permissions = permissions & Permissions.default_view_only()

return permissions
Expand Down

0 comments on commit 34a0671

Please sign in to comment.