From 5521c3bb14c53035486362719bb471718ed825c9 Mon Sep 17 00:00:00 2001 From: Andy Fang Date: Tue, 17 Jun 2014 16:04:05 -0700 Subject: [PATCH] article settings form compatibility with custom user model --- wiki/forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wiki/forms.py b/wiki/forms.py index 6519631b9..9839e5bf0 100644 --- a/wiki/forms.py +++ b/wiki/forms.py @@ -372,7 +372,7 @@ def __init__(self, article, request, *args, **kwargs): self.fields['recursive_owner'].widget = forms.HiddenInput() self.fields['locked'].widget = forms.HiddenInput() - self.fields['owner_username'].initial = article.owner.username if article.owner else "" + self.fields['owner_username'].initial = getattr(article.owner, User.USERNAME_FIELD) if article.owner else "" def clean_owner_username(self): if self.can_assign: