This commit is contained in:
sinavir 2023-03-08 01:48:29 +01:00
parent 1a7a2c00d7
commit 8646590b48
2 changed files with 27 additions and 1 deletions

View file

@ -0,0 +1,26 @@
# Generated by Django 4.1.6 on 2023-03-08 00:51
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),
("agent", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="agent",
name="user",
field=models.OneToOneField(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
]

View file

@ -4,7 +4,7 @@ from django.db import models
class Agent(models.Model):
name = models.CharField(max_length=255)
user = models.OneToOneField(User, on_delete=models.SET_NULL, null=True)
user = models.OneToOneField(User, on_delete=models.SET_NULL, blank=True, null=True)
def __repr__(self):
return f"Agent_{self.name}"