mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-30 22:29:32 +00:00
Enforce uid with uppercase for Studentcard and test more edge cases
This commit is contained in:
2 files changed
+50
-1
No files matched your search
+2
-1
@@ -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