Skip to content

Commit 1ac1014

Browse files
committed
Améliore le modèle ShareableLink (annotations de type + conditions plus claires)
1 parent 99c20cc commit 1ac1014

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

zds/tutorialv2/models/shareable_links.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def reactivate(self):
6060
self.active = True
6161
self.save()
6262

63-
def valid_indefinitely(self):
64-
return not self.expiration
63+
def valid_indefinitely(self) -> bool:
64+
return self.expiration is None
6565

66-
def expired(self):
67-
return self.expiration and self.expiration < datetime.now()
66+
def expired(self) -> bool:
67+
return (self.expiration is not None) and self.expiration < datetime.now()

0 commit comments

Comments
 (0)