Commit b46ced1c by Christian Duvholt

Better messages when adding attachments

parent 5f58fdf1
...@@ -229,6 +229,8 @@ class AttachmentAddView(ArticleMixin, View): ...@@ -229,6 +229,8 @@ class AttachmentAddView(ArticleMixin, View):
messages.success(self.request, _('Added a reference to "%(att)s" from "%(art)s".') % messages.success(self.request, _('Added a reference to "%(att)s" from "%(art)s".') %
{'att': self.attachment.original_filename, {'att': self.attachment.original_filename,
'art': self.article.current_revision.title}) 'art': self.article.current_revision.title})
else:
messages.error(self.request, _('"%(att)s" is already referenced.') % {'att': self.attachment.original_filename})
return redirect("wiki:attachments_index", path=self.urlpath.path, article_id=self.article.id) return redirect("wiki:attachments_index", path=self.urlpath.path, article_id=self.article.id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment