summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCruiseDevice2018-09-28 15:19:48 +0530
committerCruiseDevice2018-09-28 15:19:48 +0530
commit28dc99a7eea4864e5343244c94b05064c34af91e (patch)
tree1d9466c52c5fa720b5f333a339fdaed0d8732ba9
parent3a37d1c016bd08cd763be569ef706f52c8461931 (diff)
downloadsbhs_server-28dc99a7eea4864e5343244c94b05064c34af91e.tar.gz
sbhs_server-28dc99a7eea4864e5343244c94b05064c34af91e.tar.bz2
sbhs_server-28dc99a7eea4864e5343244c94b05064c34af91e.zip
some minor changes in forms.py
-remove calendar
-rw-r--r--sbhs/forms.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/sbhs/forms.py b/sbhs/forms.py
index 85b272f..43b9539 100644
--- a/sbhs/forms.py
+++ b/sbhs/forms.py
@@ -21,25 +21,25 @@ class UserLoginForm(forms.Form):
"""
User loginform
"""
- username=forms.CharField(max_length=30)
- password=forms.CharField(max_length=30, widget=forms.PasswordInput())
+ username = forms.CharField(max_length=30)
+ password = forms.CharField(max_length=30, widget=forms.PasswordInput())
class UserRegistrationForm(forms.Form):
name = forms.CharField(max_length=50)
email = forms.EmailField()
- username=forms.CharField(max_length=30,help_text='Letters, digits, period \
+ username = forms.CharField(max_length=30,help_text='Letters, digits, period \
and underscores only.')
- password=forms.CharField(max_length=30, widget=forms.PasswordInput())
- confirm_password=forms.CharField(
+ password = forms.CharField(max_length=30, widget=forms.PasswordInput())
+ confirm_password = forms.CharField(
max_length=30, widget=forms.PasswordInput()
)
roll_number = forms.CharField(max_length=30, help_text="Use a dummy if \
you don't have")
- institute=forms.CharField(max_length=128, help_text="Institute/\
+ institute = forms.CharField(max_length=128, help_text="Institute/\
Organization.")
- department=forms.CharField(max_length=64, help_text="Department you \
+ department = forms.CharField(max_length=64, help_text="Department you \
work/study at.")
position = forms.CharField(max_length=64, help_text="Student/Faculty/\
Researched/Industry/Fellowship/etc.")
@@ -47,7 +47,7 @@ class UserRegistrationForm(forms.Form):
def clean_username(self):
u_name = self.cleaned_data["username"]
if u_name.strip(UNAME_CHARS):
- msg="Only letters, digits, period and underscore characters are \
+ msg = "Only letters, digits, period and underscore characters are \
allowed in username"
raise forms.ValidationError(msg)
try:
@@ -83,20 +83,20 @@ class UserRegistrationForm(forms.Form):
u_name=self.cleaned_data["username"]
u_name = u_name.lower()
pwd = self.cleaned_data["password"]
- email=self.cleaned_data["email"]
+ email = self.cleaned_data["email"]
new_user = User.objects.create_user(u_name,email,pwd)
new_user.name = self.cleaned_data["name"]
new_user.save()
cleaned_data = self.cleaned_data
new_profile = Profile(user=new_user)
- new_profile.roll_number=cleaned_data["roll_number"]
+ new_profile.roll_number = cleaned_data["roll_number"]
new_profile.institute = cleaned_data["institute"]
new_profile.department = cleaned_data["department"]
new_profile.position = cleaned_data["position"]
if settings.IS_DEVELOPMENT:
- new_profile.is_email_verified=True
+ new_profile.is_email_verified = True
else:
new_profile.activation_key = generate_activation_key(
new_user.username
@@ -111,9 +111,5 @@ class UserRegistrationForm(forms.Form):
class SlotCreationForm(forms.ModelForm):
class Meta:
model = Slot
- fields = ['start_time','duration']
- widgets = {
- 'start_time':forms.DateInput(attrs={
- 'class':'datetimepicker'
- }),
- } \ No newline at end of file
+ fields = ['start_time']
+ \ No newline at end of file