Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge pull request #384 from aldryn/issue/fix-article-admin-issue-on-…
Browse files Browse the repository at this point in the history
…article-add

Admin: Disable add related article only if it is present.
  • Loading branch information
mkoistinen committed Apr 21, 2016
2 parents 3759585 + 9ad7896 commit f453864
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aldryn_newsblog/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def __init__(self, *args, **kwargs):
# Don't allow related articles to be added here.
# doesn't makes much sense to add articles from another article other
# than save and add another.
self.fields['related'].widget.can_add_related = False
if ('related' in self.fields and
hasattr(self.fields['related'], 'widget')):
self.fields['related'].widget.can_add_related = False


class ArticleAdmin(
Expand Down

0 comments on commit f453864

Please sign in to comment.