summaryrefslogtreecommitdiff
path: root/yaksh/forms.py
diff options
context:
space:
mode:
authoradityacp2020-02-19 12:13:38 +0530
committeradityacp2020-02-19 12:15:43 +0530
commitfcfd868e44f0c768d05ef0dd58c72e46f9cbee61 (patch)
tree8909446448aabd1c0ca26807afec4fff9ce0cd3c /yaksh/forms.py
parentf2d1d8fe76109a5b7c53e68de2bd86230874ba90 (diff)
downloadonline_test-fcfd868e44f0c768d05ef0dd58c72e46f9cbee61.tar.gz
online_test-fcfd868e44f0c768d05ef0dd58c72e46f9cbee61.tar.bz2
online_test-fcfd868e44f0c768d05ef0dd58c72e46f9cbee61.zip
Fix pep style and add test case in test_models
Diffstat (limited to 'yaksh/forms.py')
-rw-r--r--yaksh/forms.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/yaksh/forms.py b/yaksh/forms.py
index 767e51f..7d5362b 100644
--- a/yaksh/forms.py
+++ b/yaksh/forms.py
@@ -75,15 +75,17 @@ class UserRegisterForm(forms.Form):
It has the various fields and functions required to register
a new user to the system"""
- username = forms.CharField(max_length=30, help_text='Letters, digits,\
+ username = forms.CharField(
+ max_length=30, help_text='Letters, digits,\
period and underscores only.',
- widget=forms.TextInput(
- {'class': form_input_class, 'placeholder': "Username"})
- )
+ widget=forms.TextInput(
+ {'class': form_input_class, 'placeholder': "Username"})
+ )
email = forms.EmailField(widget=forms.TextInput(
{'class': form_input_class, 'placeholder': "Email"}
))
- password = forms.CharField(max_length=30,
+ password = forms.CharField(
+ max_length=30,
widget=forms.PasswordInput(
{'class': form_input_class, 'placeholder': "Password"}))
confirm_password = forms.CharField(
@@ -99,23 +101,23 @@ class UserRegisterForm(forms.Form):
roll_number = forms.CharField(
max_length=30, help_text="Use a dummy if you don't have one.",
widget=forms.TextInput(
- {'class': form_input_class, 'placeholder': "Roll Number"}
+ {'class': form_input_class, 'placeholder': "Roll Number"}
))
institute = forms.CharField(
max_length=128, help_text='Institute/Organization',
widget=forms.TextInput(
- {'class': form_input_class, 'placeholder': "Institute"}
+ {'class': form_input_class, 'placeholder': "Institute"}
))
department = forms.CharField(
max_length=64, help_text='Department you work/study at',
widget=forms.TextInput(
- {'class': form_input_class, 'placeholder': "Department"}
+ {'class': form_input_class, 'placeholder': "Department"}
))
position = forms.CharField(
max_length=64,
help_text='Student/Faculty/Researcher/Industry/Fellowship/etc.',
widget=forms.TextInput(
- {'class': form_input_class, 'placeholder': "Position"}
+ {'class': form_input_class, 'placeholder': "Position"}
))
timezone = forms.ChoiceField(
choices=[(tz, tz) for tz in pytz.common_timezones],
@@ -420,7 +422,7 @@ class CourseForm(forms.ModelForm):
{'class': 'custom-select'}
)
if (self.instance.id and
- self.instance.teachers.filter(id=user.id).exists()):
+ self.instance.teachers.filter(id=user.id).exists()):
self.fields['grading_system'].widget.attrs['disabled'] = True
else:
grading_choices = GradingSystem.objects.filter(