Set unon authenticated user to NONE
This commit is contained in:
parent
670c2b18a9
commit
32de20aaba
1 changed files with 1 additions and 1 deletions
|
@ -222,7 +222,7 @@ class UserHostingKeyForm(forms.ModelForm):
|
|||
return self.data.get('name')
|
||||
|
||||
def clean_user(self):
|
||||
return self.request.user
|
||||
return self.request.user if self.request.user.is_authenticated() else None
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = self.cleaned_data
|
||||
|
|
Loading…
Reference in a new issue