Skip to content
Snippets Groups Projects
Commit 9207dbd5 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Merge branch...

Merge branch '151-get_or_create-for-lesson-documentations-and-personal-notes-doesn-t-work-correctly-because-of' into 'master'

Resolve "get_or_create for lesson documentations and personal notes doesn't work correctly because of missing unique index"

Closes #151

See merge request !166
parents f4664b57 83ad9d5f
No related branches found
No related tags found
1 merge request!166Resolve "get_or_create for lesson documentations and personal notes doesn't work correctly because of missing unique index"
Pipeline #6562 passed
# Generated by Django 3.1.7 on 2021-03-21 17:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('chronos', '0004_substitution_extra_lesson_year'),
('alsijil', '0011_tardiness_positive'),
]
operations = [
migrations.AlterUniqueTogether(
name='lessondocumentation',
unique_together={('lesson_period', 'week', 'year', 'event', 'extra_lesson')},
),
migrations.AlterUniqueTogether(
name='personalnote',
unique_together={('lesson_period', 'week', 'year', 'event', 'extra_lesson')},
),
]
......@@ -250,6 +250,7 @@ class PersonalNote(RegisterObjectRelatedMixin, ExtensibleModel):
check=lesson_related_constraint_q, name="one_relation_only_personal_note"
)
]
unique_together = ["lesson_period", "week", "year", "event", "extra_lesson"]
class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
......@@ -337,6 +338,7 @@ class LessonDocumentation(RegisterObjectRelatedMixin, ExtensibleModel):
check=lesson_related_constraint_q, name="one_relation_only_lesson_documentation",
)
]
unique_together = ["lesson_period", "week", "year", "event", "extra_lesson"]
class ExtraMark(ExtensibleModel):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment