From 723e9e71b1a108e580e38ee73cae90980c33b261 Mon Sep 17 00:00:00 2001 From: adityacp Date: Thu, 30 Jan 2020 11:59:45 +0530 Subject: Fix pep8 in forms and views --- yaksh/forms.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'yaksh/forms.py') diff --git a/yaksh/forms.py b/yaksh/forms.py index 79342da..4229598 100644 --- a/yaksh/forms.py +++ b/yaksh/forms.py @@ -221,7 +221,7 @@ class ExerciseForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ExerciseForm, self).__init__(*args, **kwargs) self.fields['description'].widget.attrs.update( - {'class': form_input_class, 'placeholder':"Exercise Description"} + {'class': form_input_class, 'placeholder': "Exercise Description"} ) class Meta: @@ -388,13 +388,14 @@ class CourseForm(forms.ModelForm): self.fields['grading_system'].widget.attrs.update( {'class': 'custom-select'} ) - if self.instance.id and self.instance.teachers.filter(id=user.id).exists(): + if (self.instance.id and + self.instance.teachers.filter(id=user.id).exists()): self.fields['grading_system'].widget.attrs['disabled'] = True else: grading_choices = GradingSystem.objects.filter( creator=user ) - self.fields['grading_system'].queryset = grading_choices + self.fields['grading_system'].queryset = grading_choices class ProfileForm(forms.ModelForm): @@ -485,10 +486,10 @@ class LessonForm(forms.ModelForm): class LessonFileForm(forms.Form): - Lesson_files = forms.FileField(widget=forms.ClearableFileInput( - attrs={'multiple': True, - 'class': "custom-file-input"}), - required=False) + Lesson_files = forms.FileField( + widget=forms.ClearableFileInput( + attrs={'multiple': True, 'class': "custom-file-input"}), + required=False) class LearningModuleForm(forms.ModelForm): -- cgit