Hotfix for registration crashing due to non-unique StudentStatus instance creation

This commit is contained in:
Keannu Christian Bernasol 2023-10-02 00:46:44 +08:00
parent 1eb1f71232
commit d7f88e1770
16 changed files with 27 additions and 102 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 4.2.3 on 2023-09-25 13:07
# Generated by Django 4.2.5 on 2023-10-01 16:37
from django.conf import settings
import django.contrib.gis.db.models.fields
@ -11,23 +11,24 @@ class Migration(migrations.Migration):
initial = True
dependencies = [
('accounts', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('study_groups', '0001_initial'),
('landmarks', '0001_initial'),
('subjects', '0001_initial'),
('landmarks', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='StudentStatus',
fields=[
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('location', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
('active', models.BooleanField(default=False)),
('timestamp', models.DateTimeField(auto_now_add=True)),
('landmark', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='landmarks.landmark')),
('study_group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='students', to='study_groups.studygroup')),
('subject', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='subjects.subject', to_field='name')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]