diff --git a/preferences/migrations/0035_auto_20180715_1637.py b/preferences/migrations/0035_auto_20180715_1637.py new file mode 100644 index 00000000..5c0a3cb1 --- /dev/null +++ b/preferences/migrations/0035_auto_20180715_1637.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-07-15 14:37 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('preferences', '0034_auto_20180416_1120'), + ] + + operations = [ + migrations.AddField( + model_name='optionaluser', + name='mail_verification', + field=models.BooleanField(default=True, help_text='Vérification du mail obligatoire'), + ), + migrations.AddField( + model_name='optionaluser', + name='verification_time', + field=models.PositiveIntegerField(blank=True, help_text='Durée (en heures) pour vérifier son compte (laisser vide pour ne pas avoir de limite', null=True), + ), + ] diff --git a/users/migrations/0073_auto_20180715_1647.py b/users/migrations/0073_auto_20180715_1647.py new file mode 100644 index 00000000..9701220e --- /dev/null +++ b/users/migrations/0073_auto_20180715_1647.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-07-15 14:47 +from __future__ import unicode_literals + +from django.db import migrations, models + +def update(apps, schema_editor): + User = apps.get_model('users', 'User') + for u in User.objects.all(): + u.verified = True + u.save() + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0072_auto_20180426_2021'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='verification_deadline', + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AddField( + model_name='user', + name='verified', + field=models.BooleanField(default=False), + ), + migrations.RunPython(update) + ] diff --git a/users/models.py b/users/models.py index ae7dd4d1..e885ab83 100644 --- a/users/models.py +++ b/users/models.py @@ -232,6 +232,7 @@ class User(RevMixin, FieldPermissionModelMixin, AbstractBaseUser, blank=True, null = True ) + verification_uuid = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) USERNAME_FIELD = 'pseudo' REQUIRED_FIELDS = ['surname', 'email']