Skip to content
Snippets Groups Projects
Commit 27d8f0dd authored by magicfelix's avatar magicfelix
Browse files

Remove not working constraint

parent ca799cae
No related branches found
No related tags found
1 merge request!350Resolve "Add simple course book list"
...@@ -89,8 +89,4 @@ class Migration(migrations.Migration): ...@@ -89,8 +89,4 @@ class Migration(migrations.Migration):
model_name='newpersonalnote', model_name='newpersonalnote',
constraint=models.CheckConstraint(check=models.Q(models.Q(('note', ''), _negated=True), ('extra_mark__isnull', False), _connector='OR'), name='unique_absence_per_documentation'), constraint=models.CheckConstraint(check=models.Q(models.Q(('note', ''), _negated=True), ('extra_mark__isnull', False), _connector='OR'), name='unique_absence_per_documentation'),
), ),
migrations.AddConstraint(
model_name='documentation',
constraint=models.CheckConstraint(check=models.Q(('amends__isnull', True), ('course__isnull', True), _negated=True), name='either_course_or_amends'),
),
] ]
...@@ -511,12 +511,8 @@ class Documentation(CalendarEvent): ...@@ -511,12 +511,8 @@ class Documentation(CalendarEvent):
class Meta: class Meta:
verbose_name = _("Documentation") verbose_name = _("Documentation")
verbose_name_plural = _("Documentations") verbose_name_plural = _("Documentations")
constraints = [ # should check if object has either course or amends,
models.CheckConstraint( # which is not possible via constraint, because amends is not local to Documentation
check=~Q(course__isnull=True, amends__isnull=True),
name="either_course_or_amends",
),
]
@classmethod @classmethod
def get_for_coursebook( def get_for_coursebook(
......
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