Skip to content

Commit

Permalink
fix: TypeError in WorkspaceInvite.has_expired because updated_at is N…
Browse files Browse the repository at this point in the history
…one before db insert
  • Loading branch information
nikochiko committed Mar 10, 2025
1 parent 673be82 commit d61f2ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion workspaces/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,9 @@ def clean(self) -> None:

@admin.display(description="Expired")
def has_expired(self):
return timezone.now() - self.updated_at > timedelta(
if not self.updated_at:
return False
return (timezone.now() - self.updated_at) > timedelta(
days=settings.WORKSPACE_INVITE_EXPIRY_DAYS
)

Expand Down

0 comments on commit d61f2ff

Please sign in to comment.