Skip to content

Commit

Permalink
Clarify error message when cancelling author-play link for play with …
Browse files Browse the repository at this point in the history
…single author
  • Loading branch information
FinemechanicPub committed Sep 22, 2024
1 parent a538758 commit adb6638
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/library/admin/author.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class PlayInlineForm(ModelForm):
def clean_DELETE(self):
data = self.cleaned_data["DELETE"]
if data and self.instance.play.author_plays.count() == 1:
error = ValidationError("Эта пьеса не может быть удалена, так как это единственный её автор")
error = ValidationError(
"Отказаться от авторства нельзя, так как это единственный автор. Удалить пьесу можно в разделе пьес."
)
self.add_error(field=None, error=error)
raise error
return data
Expand Down

0 comments on commit adb6638

Please sign in to comment.