mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-06-28 15:53:57 +00:00
Add TemporaryUser model and related functionality for user registration and OTP verification
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m19s
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 1m19s
This commit is contained in:
@ -0,0 +1,97 @@
|
||||
# Generated by Django 5.2 on 2025-04-16 05:13
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
import pyotp
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("api", "0014_alter_user_email"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name="user",
|
||||
name="created_at",
|
||||
field=models.DateTimeField(default=django.utils.timezone.now),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name="user",
|
||||
name="updated_at",
|
||||
field=models.DateTimeField(auto_now=True),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name="TemporaryUser",
|
||||
fields=[
|
||||
("t_id", models.AutoField(primary_key=True, serialize=False)),
|
||||
(
|
||||
"t_username",
|
||||
models.CharField(
|
||||
blank=True, max_length=255, null=True, unique=True
|
||||
),
|
||||
),
|
||||
("t_first_name", models.CharField(blank=True, max_length=255)),
|
||||
("t_last_name", models.CharField(blank=True, max_length=255)),
|
||||
("t_address", models.CharField(blank=True, max_length=255)),
|
||||
(
|
||||
"t_email",
|
||||
models.EmailField(
|
||||
blank=True, max_length=254, null=True, unique=True
|
||||
),
|
||||
),
|
||||
(
|
||||
"t_mobile",
|
||||
models.CharField(
|
||||
blank=True, max_length=255, null=True, unique=True
|
||||
),
|
||||
),
|
||||
("t_designation", models.CharField(blank=True, max_length=255)),
|
||||
("t_acc_no", models.CharField(blank=True, max_length=255)),
|
||||
(
|
||||
"t_id_card",
|
||||
models.CharField(
|
||||
blank=True, max_length=255, null=True, unique=True
|
||||
),
|
||||
),
|
||||
("t_verified", models.BooleanField(default=False)),
|
||||
("t_dob", models.DateField(blank=True, null=True)),
|
||||
("t_terms_accepted", models.BooleanField(default=False)),
|
||||
("t_policy_accepted", models.BooleanField(default=False)),
|
||||
("t_wallet_balance", models.FloatField(default=0.0)),
|
||||
("t_ninja_user_id", models.CharField(blank=True, max_length=255)),
|
||||
("created_at", models.DateTimeField(default=django.utils.timezone.now)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
(
|
||||
"otp_secret",
|
||||
models.CharField(default=pyotp.random_base32, max_length=50),
|
||||
),
|
||||
("otp_verified", models.BooleanField(default=False)),
|
||||
(
|
||||
"t_atoll",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="temp_users",
|
||||
to="api.atoll",
|
||||
),
|
||||
),
|
||||
(
|
||||
"t_island",
|
||||
models.ForeignKey(
|
||||
blank=True,
|
||||
null=True,
|
||||
on_delete=django.db.models.deletion.SET_NULL,
|
||||
related_name="temp_users",
|
||||
to="api.island",
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name": "Temporary User",
|
||||
"verbose_name_plural": "Temporary Users",
|
||||
},
|
||||
),
|
||||
]
|
Reference in New Issue
Block a user