save should raise TypeError is saving is not allowed
This commit is contained in:
parent
b4c640254f
commit
fe0c2a1b48
1 changed files with 2 additions and 2 deletions
|
@ -147,7 +147,7 @@ class Change(models.Model):
|
|||
def save(self, *args, **kwargs):
|
||||
self.full_clean()
|
||||
if self.pk is not None:
|
||||
raise ValidationError('change objects can not be edited.')
|
||||
raise TypeError('change objects can not be edited.')
|
||||
if self.changeset.proposed is not None or self.changeset.applied is not None:
|
||||
raise ValidationError('can not add change object to uneditable changeset.')
|
||||
raise TypeError('can not add change object to uneditable changeset.')
|
||||
super().save(*args, **kwargs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue