Commit 5008375bf23dcbdbaffab6f0a9e629c7049d6e93

Authored by carol15022
Committed by Sergio Oliveira
1 parent d6414cc4

Flake8 accounts

Showing 1 changed file with 11 additions and 11 deletions   Show diff stats
colab/accounts/forms.py
... ... @@ -2,7 +2,6 @@
2 2  
3 3 from collections import OrderedDict
4 4  
5   -from django.http import HttpRequest
6 5 from django import forms
7 6 from django.contrib.auth import authenticate, get_user_model
8 7 from django.contrib.auth.forms import ReadOnlyPasswordHashField
... ... @@ -61,19 +60,19 @@ class UserForm(forms.ModelForm):
61 60 if not username:
62 61 raise forms.ValidationError(_('This field cannot be blank.'))
63 62 return username
64   -
  63 +
65 64 def clean_first_name(self):
66   - first_name = self.cleaned_data["first_name"].strip()
  65 + first_name = self.cleaned_data["first_name"].strip()
67 66 if not first_name:
68 67 raise forms.ValidationError(_('This field cannot be blank.'))
69 68 return first_name
70   -
  69 +
71 70 def clean_last_name(self):
72 71 last_name = self.cleaned_data["last_name"].strip()
73 72 if not last_name:
74 73 raise forms.ValidationError(_('This field cannot be blank.'))
75 74 return last_name
76   -
  75 +
77 76 def clean_twitter(self):
78 77 twitter = self.cleaned_data["twitter"]
79 78 if twitter is not None and twitter.isspace():
... ... @@ -89,11 +88,11 @@ class UserForm(forms.ModelForm):
89 88 def clean_webpage(self):
90 89 webpage = self.cleaned_data["webpage"].strip()
91 90 return webpage
92   -
  91 +
93 92 def clean_role(self):
94 93 role = self.cleaned_data["role"].strip()
95   - return role
96   -
  94 + return role
  95 +
97 96 def clean_institution(self):
98 97 institution = self.cleaned_data["institution"].strip()
99 98 return institution
... ... @@ -101,11 +100,12 @@ class UserForm(forms.ModelForm):
101 100 def clean_bio(self):
102 101 bio = self.cleaned_data["bio"].strip()
103 102 return bio
104   -
  103 +
105 104 def clean_github(self):
106 105 github = self.cleaned_data["github"].strip()
107   - return github
108   -
  106 + return github
  107 +
  108 +
109 109 class UserUpdateForm(UserForm):
110 110 bio = forms.CharField(
111 111 widget=forms.Textarea(attrs={'rows': '6', 'maxlength': '200'}),
... ...