Commit 20f14168 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by root

No crash à la migration initiale

parent 3d41b71b
......@@ -44,7 +44,10 @@ def linux_user_validator(login):
def get_fresh_user_uid():
uids = list(range(int(min(UID_RANGES['users'])),int(max(UID_RANGES['users']))))
used_uids = [ user.uid_number for user in User.objects.all()]
used_uids = []
free_uids = [ id for id in uids if id not in used_uids]
return min(free_uids)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment