diff --git a/workspaces/models.py b/workspaces/models.py index 7ec13a439..aa263afcb 100644 --- a/workspaces/models.py +++ b/workspaces/models.py @@ -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 )