Fixed #107 and fixed #125 -- Periodic cleanup tasks

This commit is contained in:
Raphael Michel
2016-03-26 19:10:31 +01:00
parent 6e60332948
commit 1011893543
8 changed files with 59 additions and 2 deletions

View File

@@ -299,6 +299,11 @@ class QuestionAnswer(models.Model):
else:
return self.answer
def save(self, *args, **kwargs):
if self.orderposition and self.cartposition:
raise ValueError('QuestionAnswer cannot be linked to an order and a cart position at the same time.')
super().save(*args, **kwargs)
class AbstractPosition(models.Model):
"""