mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
counter: fix a bug where you can't register UID card with only number inside
This commit is contained in:
@ -749,7 +749,7 @@ class StudentCard(models.Model):
|
||||
@staticmethod
|
||||
def is_valid(uid):
|
||||
return (
|
||||
uid.isupper()
|
||||
(uid.isupper() or uid.isnumeric())
|
||||
and len(uid) == StudentCard.UID_SIZE
|
||||
and not StudentCard.objects.filter(uid=uid).exists()
|
||||
)
|
||||
|
Reference in New Issue
Block a user