Skip to content
Browse files

flake8 fixes

- New version of flake8 has added new error codes that have been ignored
- The change to notifications seems to be a bug; unclear why flake8 didn't highlight that earlier
  • Loading branch information...
philipbelesky committed Nov 3, 2018
1 parent 26fa8ba commit 48ce440505e7213e2d54549b68bce4965e3f2a22
@@ -8,12 +8,14 @@
# E231 = missing whitespace after ','
# E261 = at least two spaces before inline comment
# E305 = expected 2 blank lines after class or function definition
# W504 = line break after binary operator
# W605 = invalid escape sequence

# I100 = Imported names are in the wrong order.

# Q000 = double quotes

ignore = E126,E127,E128,E221,E226,E261,E203,E231,E241,E305,E722,Q000,I100,I202
ignore = E126,E127,E128,E221,E226,E261,E203,E231,E241,E305,E722,Q000,I100,I202,W504,W605

max-line-length = 200

@@ -261,7 +261,7 @@ def clean_emails(self):
for email in emails:
except ValidationError as e:
except ValidationError:
self.add_error('emails', _("%(email)s is not a valid email address.") % {'email': email})
return emails

@@ -273,7 +273,7 @@ def _import(self, csvfile, model, interpreter=make_interpreter(), expect_unique=
# Create (but don't save) an instance (or handle an error)
inst = model.objects.get(**kwargs)
except ObjectDoesNotExist as e:
except ObjectDoesNotExist:
inst = model(**kwargs) # normal case (create object)
except MultipleObjectsReturned as e:
if expect_unique:
@@ -206,7 +206,7 @@ def _create_motion_list():
context_user = context.copy()
context_user['USER'] =

emails.append((context_user, speaker))
emails.append((context_user, person))

return emails

@@ -98,7 +98,7 @@ def get_redirect_url(self, *args, **kwargs):
def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)
except (MultipleDebateTeamsError, NoDebateTeamFoundError) as e:
except (MultipleDebateTeamsError, NoDebateTeamFoundError):
if hasattr(self.request, 'user') and self.request.user.is_superuser:
logger.warning("Debate team side assignment error, redirecting to tournament-fix-debate-teams")
messages.warning(request, _("You've been redirected to this page because of a problem with "
@@ -36,7 +36,7 @@ def get_data_from_request(self, request):
if tournament is not None:
extra_info = result.setdefault('extra', {})
extra_info['tournament_prefs'] = request.tournament.preferences.all()
except Exception as e:
except Exception:
pass # again, best efforts only

return result

0 comments on commit 48ce440

Please sign in to comment.
You can’t perform that action at this time.