diff --git a/judge/admin/interface.py b/judge/admin/interface.py index ffc4eee2c7..30a359ba83 100644 --- a/judge/admin/interface.py +++ b/judge/admin/interface.py @@ -54,7 +54,9 @@ class FlatPageAdmin(VersionAdmin, OldFlatPageAdmin): class BlogPostForm(ModelForm): def __init__(self, *args, **kwargs): super(BlogPostForm, self).__init__(*args, **kwargs) - self.fields['authors'].widget.can_add_related = False + if 'authors' in self.fields: + # self.fields['authors'] does not exist when the user has only view permission on the model. + self.fields['authors'].widget.can_add_related = False class Meta: widgets = {