Skip to content

Commit

Permalink
#476 Fix E201 whitespace after
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlittle committed Nov 3, 2019
1 parent 02a3b02 commit eadd926
Show file tree
Hide file tree
Showing 22 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion av/forms.py
Expand Up @@ -24,7 +24,7 @@ class UploadMediaForm(forms.Form):

def __init__(self, *args, **kwargs):
self.request = kwargs.pop('request', None)
super(UploadMediaForm, self).__init__( * args, ** kwargs)
super(UploadMediaForm, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_action = reverse('oppia_av_upload')
self.helper.form_class = 'form-horizontal'
Expand Down
2 changes: 1 addition & 1 deletion content/forms.py
Expand Up @@ -15,7 +15,7 @@ class MediaEmbedHelperForm(forms.Form):
error_messages={'required': _('Please enter the media url')}, )

def __init__(self, *args, **kwargs):
super(MediaEmbedHelperForm, self).__init__( * args, ** kwargs)
super(MediaEmbedHelperForm, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_class = 'form-horizontal'
self.helper.label_class = 'col-lg-2'
Expand Down
6 changes: 3 additions & 3 deletions gamification/forms.py
Expand Up @@ -14,7 +14,7 @@ class EditCoursePointsForm(forms.Form):
def __init__(self, *args, **kwargs):
initial = kwargs.pop('initial', None)

super(EditCoursePointsForm, self).__init__( * args, ** kwargs)
super(EditCoursePointsForm, self).__init__(* args, ** kwargs)
for event in initial:
try:
self.fields[event.event] = forms.IntegerField(initial=event.points,
Expand Down Expand Up @@ -52,7 +52,7 @@ class EditActivityPointsForm(forms.Form):
def __init__(self, *args, **kwargs):
initial = kwargs.pop('initial', None)

super(EditActivityPointsForm, self).__init__( * args, ** kwargs)
super(EditActivityPointsForm, self).__init__(* args, ** kwargs)
for event in initial:
try:
self.fields[event.event] = forms.IntegerField(initial=int(event.points),
Expand Down Expand Up @@ -93,7 +93,7 @@ class EditMediaPointsForm(forms.Form):
def __init__(self, *args, **kwargs):
initial = kwargs.pop('initial', None)

super(EditMediaPointsForm, self).__init__( * args, ** kwargs)
super(EditMediaPointsForm, self).__init__(* args, ** kwargs)
for event in initial:
try:
self.fields[event.event] = forms.IntegerField(initial=int(event.points),
Expand Down
2 changes: 1 addition & 1 deletion oppia/forms/cohort.py
Expand Up @@ -28,7 +28,7 @@ class CohortForm(forms.Form):
help_text=_("A comma separated list of course codes"), )

def __init__(self, *args, **kwargs):
super(CohortForm, self).__init__( * args, ** kwargs)
super(CohortForm, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_class = 'form-horizontal'
self.helper.form_tag = False
Expand Down
4 changes: 2 additions & 2 deletions oppia/forms/upload.py
Expand Up @@ -17,7 +17,7 @@ class UploadCourseStep1Form(forms.Form):
error_messages={'required': _('Please select a file to upload')}, )

def __init__(self, *args, **kwargs):
super(UploadCourseStep1Form, self).__init__( * args, ** kwargs)
super(UploadCourseStep1Form, self).__init__(* args, ** kwargs)

max_upload = SettingProperties.get_int(constants.MAX_UPLOAD_SIZE, settings.OPPIA_MAX_UPLOAD_SIZE)
self.fields['course_file'].help_text = _('Max size %(size)d Mb') % {'size': int(math.floor(max_upload / 1024 / 1024))}
Expand Down Expand Up @@ -61,7 +61,7 @@ class UploadCourseStep2Form(forms.Form):
required=False, )

def __init__(self, *args, **kwargs):
super(UploadCourseStep2Form, self).__init__( * args, ** kwargs)
super(UploadCourseStep2Form, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_class = 'form-horizontal'
self.helper.label_class = 'col-lg-2'
Expand Down
2 changes: 1 addition & 1 deletion oppia/views.py
Expand Up @@ -449,7 +449,7 @@ def export_tracker_detail(request, course_id):

headers = ('Date', 'UserId', 'Type', 'Activity Title', 'Section Title', 'Time Taken', 'IP Address', 'User Agent', 'Language')
data = []
data = tablib.Dataset( * data, headers=headers)
data = tablib.Dataset(* data, headers=headers)
trackers = Tracker.objects.filter(course=course).order_by('-tracker_date')
for t in trackers:
try:
Expand Down
2 changes: 1 addition & 1 deletion oppiamobile/urls.py
Expand Up @@ -34,5 +34,5 @@


if settings.DEVICE_ADMIN_ENABLED:
gcmpatterns = [ url(r'^deviceadmin/', include('deviceadmin.urls')), ]
gcmpatterns = [url(r'^deviceadmin/', include('deviceadmin.urls')), ]
urlpatterns += gcmpatterns
2 changes: 1 addition & 1 deletion profile/forms/login.py
Expand Up @@ -15,7 +15,7 @@ class LoginForm(forms.Form):
next = forms.CharField(widget=forms.HiddenInput())

def __init__(self, *args, **kwargs):
super(LoginForm, self).__init__( * args, ** kwargs)
super(LoginForm, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_action = reverse('profile_login')
self.helper.form_class = 'form-horizontal'
Expand Down
2 changes: 1 addition & 1 deletion profile/forms/profile.py
Expand Up @@ -38,7 +38,7 @@ class ProfileForm(forms.Form):
organisation = forms.CharField(max_length=100, required=False)

def __init__(self, *args, **kwargs):
super(ProfileForm, self).__init__( * args, ** kwargs)
super(ProfileForm, self).__init__(* args, ** kwargs)
if len(args) == 1:
email = args[0]['email']
username = args[0]['username']
Expand Down
2 changes: 1 addition & 1 deletion profile/forms/register.py
Expand Up @@ -42,7 +42,7 @@ class RegisterForm(forms.Form):
organisation = forms.CharField(max_length=100, required=False)

def __init__(self, *args, **kwargs):
super(RegisterForm, self).__init__( * args, ** kwargs)
super(RegisterForm, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_action = reverse('profile_register')
self.helper.form_class = 'form-horizontal'
Expand Down
2 changes: 1 addition & 1 deletion profile/forms/reset.py
Expand Up @@ -14,7 +14,7 @@ class ResetForm(forms.Form):
required=True)

def __init__(self, *args, **kwargs):
super(ResetForm, self).__init__( * args, ** kwargs)
super(ResetForm, self).__init__(* args, ** kwargs)
self.fields['username'].label = "Username or email"
self.helper = FormHelper()
self.helper.form_action = reverse('profile_reset')
Expand Down
2 changes: 1 addition & 1 deletion profile/forms/search.py
Expand Up @@ -18,7 +18,7 @@ class UserSearchForm(forms.Form):
end_date = forms.CharField(required=False, label=False)

def __init__(self, *args, **kwargs):
super(UserSearchForm, self).__init__( * args, ** kwargs)
super(UserSearchForm, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_class = 'form-horizontal'
self.helper.label_class = 'col-sm-3 col-md-2 col-lg-2 control-label'
Expand Down
2 changes: 1 addition & 1 deletion profile/forms/upload.py
Expand Up @@ -19,7 +19,7 @@ class UploadProfileForm(forms.Form):
error_messages={'required': _('Please select a file to upload')}, )

def __init__(self, *args, **kwargs):
super(UploadProfileForm, self).__init__( * args, ** kwargs)
super(UploadProfileForm, self).__init__(* args, ** kwargs)
self.helper = FormHelper()
self.helper.form_action = reverse('profile_upload')
self.helper.form_class = 'form-horizontal'
Expand Down
4 changes: 2 additions & 2 deletions profile/views.py
Expand Up @@ -517,7 +517,7 @@ def get_query(query_string, search_fields):
'''
query = None # Query to search in every field
for field_name in search_fields:
q = Q( ** {"%s__icontains" % field_name: query_string})
q = Q(** {"%s__icontains" % field_name: query_string})
query = q if query is None else (query | q)

return query
Expand Down Expand Up @@ -548,7 +548,7 @@ def search_users(request):
if search_form.is_valid():
filters = get_filters_from_row(search_form)
if filters:
users = users.filter( ** filters)
users = users.filter(** filters)
filtered = True

if not filtered:
Expand Down
2 changes: 1 addition & 1 deletion summary/models/user_course_summary.py
Expand Up @@ -48,7 +48,7 @@ def update_summary(self,
}
if newest_points_pk > 0:
filters['pk__lte'] = newest_points_pk
new_points = Points.objects.filter( ** filters).aggregate(total=Sum('points'))['total']
new_points = Points.objects.filter(** filters).aggregate(total=Sum('points'))['total']

if new_points:
self.points = (0 if first_points else self.points) + new_points
Expand Down
2 changes: 1 addition & 1 deletion summary/models/user_points_summary.py
Expand Up @@ -26,7 +26,7 @@ def update_points(self, last_points_pk=0, newest_points_pk=0): # range of point
if newest_points_pk > 0:
filters['pk__lte'] = newest_points_pk

new_points = Points.objects.filter( ** filters).aggregate(total=Sum('points'))['total']
new_points = Points.objects.filter(** filters).aggregate(total=Sum('points'))['total']

if not new_points:
return
Expand Down
2 changes: 1 addition & 1 deletion tests/activitylog/test_activitylog.py
Expand Up @@ -53,7 +53,7 @@ def test_correct_file(self):

self.client.login(username=ADMIN_USER['user'],
password=ADMIN_USER['password'])

with open(self.basic_activity_log, 'rb') as activity_log_file:
response = self.client.post(self.url,
{'activity_log_file': activity_log_file})
Expand Down
4 changes: 2 additions & 2 deletions tests/api/test_media_upload.py
Expand Up @@ -44,8 +44,8 @@ def test_required_params(self):

# shouldn't be strictly necessary to close the file,
# but avoids ResourceWarnings about unclosed files
video_file.close()
video_file.close()

# check authentication check working correctly
def test_authentication(self):

Expand Down
2 changes: 1 addition & 1 deletion tests/oppia/uploader/test_helpers.py
Expand Up @@ -29,7 +29,7 @@ def test_create_quiz_props(self):

create_quiz_props(quiz, quiz_obj)

# now check the props have been saved correctly
# now check the props have been saved correctly
# (using the sample quiz file)
quiz_prop_count = QuizProps.objects.filter(quiz=quiz).count()
self.assertEqual(quiz_prop_count, 7)
Expand Down
12 changes: 6 additions & 6 deletions tests/profile/views/test_edit.py
Expand Up @@ -348,7 +348,7 @@ def test_edit_other_password_staff(self):
'last_name': 'user',
'password': 'newpassword',
'password_again': 'newpassword'}
response = self.client.post(reverse('profile_edit_user',
response = self.client.post(reverse('profile_edit_user',
args=[2]), data=post_data)
self.assertEqual(response.status_code, 200)

Expand Down Expand Up @@ -419,7 +419,7 @@ def test_edit_existing_email(self):
def test_delete_account_admin(self):
self.client.login(username=ADMIN_USER['user'],
password=ADMIN_USER['password'])
post_data = { 'username': 'admin', 'password': 'password'}
post_data = {'username': 'admin', 'password': 'password'}
response = self.client.post(reverse('profile_delete_account'),
data=post_data)
self.assertRedirects(response,
Expand All @@ -430,7 +430,7 @@ def test_delete_account_admin(self):
def test_delete_account_staff(self):
self.client.login(username=STAFF_USER['user'],
password=STAFF_USER['password'])
post_data = { 'username': 'staff', 'password': 'password'}
post_data = {'username': 'staff', 'password': 'password'}
response = self.client.post(reverse('profile_delete_account'),
data=post_data)
self.assertRedirects(response,
Expand All @@ -441,7 +441,7 @@ def test_delete_account_staff(self):
def test_delete_account_teacher(self):
self.client.login(username=TEACHER_USER['user'],
password=TEACHER_USER['password'])
post_data = { 'username': 'teacher', 'password': 'password'}
post_data = {'username': 'teacher', 'password': 'password'}
response = self.client.post(reverse('profile_delete_account'),
data=post_data)
self.assertRedirects(response,
Expand All @@ -452,7 +452,7 @@ def test_delete_account_teacher(self):
def test_delete_account_user(self):
self.client.login(username=NORMAL_USER['user'],
password=NORMAL_USER['password'])
post_data = { 'username': 'demo', 'password': 'password'}
post_data = {'username': 'demo', 'password': 'password'}
response = self.client.post(reverse('profile_delete_account'),
data=post_data)
self.assertRedirects(response,
Expand All @@ -463,7 +463,7 @@ def test_delete_account_user(self):
def test_delete_account_wrong_password(self):
self.client.login(username=NORMAL_USER['user'],
password=NORMAL_USER['password'])
post_data = { 'username': 'demo', 'password': 'wrongpassword'}
post_data = {'username': 'demo', 'password': 'wrongpassword'}
self.client.post(reverse('profile_delete_account'), data=post_data)
self.assertRaisesMessage(forms.ValidationError,
'Invalid password. Please try again. ')
Expand Down
2 changes: 1 addition & 1 deletion tests/test_course_upload.py
Expand Up @@ -30,7 +30,7 @@ def test_upload_template(self):
response = self.client.post(reverse('oppia_upload'),
{'course_file': course_file})
# should be redirected to the update step 2 form
self.assertRedirects(response, reverse('oppia_upload2',
self.assertRedirects(response, reverse('oppia_upload2',
args=[1]),
302,
200)
10 changes: 5 additions & 5 deletions tests/views/test_permissions.py
Expand Up @@ -62,7 +62,7 @@ def test_student_cantview_admin(self):
res = self.get_view(route, NORMAL_USER)
self.assertRedirects(res, route + 'login/?next=' + route)
# Upload courses view

def test_anon_cantview_upload_courses(self):
self.assert_must_login('oppia_upload')

Expand All @@ -77,7 +77,7 @@ def test_student_cantview_upload_courses(self):

def test_user_with_canupload_canview_upload_courses(self):
self.assert_can_view('oppia_upload', TEACHER_USER)

# Bulk upload users view

def test_anon_cantview_bulk_upload(self):
Expand All @@ -91,7 +91,7 @@ def test_staff_cantview_bulk_upload(self):

def test_student_cantview_bulk_upload(self):
self.assert_unauthorized('profile_upload', NORMAL_USER)

# View cohort list

def test_anon_cantview_cohorts(self):
Expand Down Expand Up @@ -173,7 +173,7 @@ def test_staff_canview_add_cohort(self):

def test_student_cantview_add_cohort(self):
self.assert_unauthorized('oppia_cohort_add', NORMAL_USER)

# courses list view

def test_anon_cantview_courses_list(self):
Expand All @@ -193,7 +193,7 @@ def test_student_cantview_courses_list(self):
res = self.assert_can_view('oppia_course', NORMAL_USER)
# check that the number of courses dont include the draft ones
self.assertEqual(res.context['page'].paginator.count, 2)

# View course recent activity

def test_anon_cantview_course_activity(self):
Expand Down

0 comments on commit eadd926

Please sign in to comment.