Commit 915d5e89 authored by Maël Kervella's avatar Maël Kervella

Fix: user.models.User.auto_uid can't be static

parent 0065e2e0
......@@ -37,6 +37,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='user',
name='uid_number',
field=models.IntegerField(unique=True, default=users.models.User.auto_uid),
field=models.IntegerField(unique=True, default=users.models.get_fresh_user_uid),
),
]
......@@ -32,6 +32,6 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='user',
name='uid_number',
field=models.PositiveIntegerField(default=users.models.User.auto_uid, unique=True),
field=models.PositiveIntegerField(default=users.models.get_fresh_user_uid, unique=True),
),
]
......@@ -187,12 +187,6 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
(2, 'STATE_ARCHIVE'),
)
# TODO : Use only one of auto_uid and get_fresh_user_uid
@staticmethod
def auto_uid():
"""Renvoie un uid libre"""
return get_fresh_user_uid()
surname = models.CharField(max_length=255)
pseudo = models.CharField(
max_length=32,
......@@ -222,7 +216,10 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser,
state = models.IntegerField(choices=STATES, default=STATE_ACTIVE)
registered = models.DateTimeField(auto_now_add=True)
telephone = models.CharField(max_length=15, blank=True, null=True)
uid_number = models.PositiveIntegerField(default=auto_uid, unique=True)
uid_number = models.PositiveIntegerField(
default=get_fresh_user_uid,
unique=True
)
rezo_rez_uid = models.PositiveIntegerField(
unique=True,
blank=True,
......
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