mirror of
https://github.com/ae-utbm/sith.git
synced 2025-11-23 21:26:56 +00:00
Enforce uid with uppercase for Studentcard and test more edge cases
This commit is contained in:
@@ -749,7 +749,8 @@ class StudentCard(models.Model):
|
||||
@staticmethod
|
||||
def is_valid(uid):
|
||||
return (
|
||||
len(uid) == StudentCard.UID_SIZE
|
||||
uid.isupper()
|
||||
and len(uid) == StudentCard.UID_SIZE
|
||||
and not StudentCard.objects.filter(uid=uid).exists()
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user