mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-27 15:12:25 +00:00
No crash à la migration initiale
This commit is contained in:
parent
3d41b71b01
commit
20f141686b
1 changed files with 4 additions and 1 deletions
|
@ -44,7 +44,10 @@ def linux_user_validator(login):
|
||||||
|
|
||||||
def get_fresh_user_uid():
|
def get_fresh_user_uid():
|
||||||
uids = list(range(int(min(UID_RANGES['users'])),int(max(UID_RANGES['users']))))
|
uids = list(range(int(min(UID_RANGES['users'])),int(max(UID_RANGES['users']))))
|
||||||
used_uids = [ user.uid_number for user in User.objects.all()]
|
try:
|
||||||
|
used_uids = [ user.uid_number for user in User.objects.all()]
|
||||||
|
except:
|
||||||
|
used_uids = []
|
||||||
free_uids = [ id for id in uids if id not in used_uids]
|
free_uids = [ id for id in uids if id not in used_uids]
|
||||||
return min(free_uids)
|
return min(free_uids)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue