From 8246c2e411ea7dcd11a9f53bb5e83300c4f4c449 Mon Sep 17 00:00:00 2001 From: SKairinos Date: Wed, 27 Sep 2023 14:37:00 +0100 Subject: [PATCH] feedback --- cfl_common/common/migrations/0045_otp.py | 14 +++----------- cfl_common/common/models.py | 10 +++------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/cfl_common/common/migrations/0045_otp.py b/cfl_common/common/migrations/0045_otp.py index 3d9c5f9e6..8ae203bcf 100644 --- a/cfl_common/common/migrations/0045_otp.py +++ b/cfl_common/common/migrations/0045_otp.py @@ -1,14 +1,11 @@ -# Generated by Django 3.2.20 on 2023-09-27 13:23 +# Generated by Django 3.2.20 on 2023-09-27 13:36 -from django.conf import settings from django.db import migrations, models -import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('common', '0044_update_activity_models'), ] @@ -16,16 +13,11 @@ class Migration(migrations.Migration): migrations.AddField( model_name='userprofile', name='last_otp_for_time', - field=models.DateTimeField(null=True), + field=models.DateTimeField(blank=True, null=True), ), migrations.AddField( model_name='userprofile', name='otp_secret', - field=models.CharField(max_length=40, null=True), - ), - migrations.AlterField( - model_name='userprofile', - name='user', - field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL), + field=models.CharField(blank=True, max_length=40, null=True), ), ] diff --git a/cfl_common/common/models.py b/cfl_common/common/models.py index 8887cc717..62e88e3ef 100644 --- a/cfl_common/common/models.py +++ b/cfl_common/common/models.py @@ -12,14 +12,10 @@ class UserProfile(models.Model): - user = models.OneToOneField( - User, - related_name="profile", - on_delete=models.CASCADE, - ) + user = models.OneToOneField(User, on_delete=models.CASCADE) - otp_secret = models.CharField(max_length=40, null=True) - last_otp_for_time = models.DateTimeField(null=True) + otp_secret = models.CharField(max_length=40, null=True, blank=True) + last_otp_for_time = models.DateTimeField(null=True, blank=True) developer = models.BooleanField(default=False) is_verified = models.BooleanField(default=False)