flake8 code cleanup

Flake8 was nitpicking about:

ihatemoney/forms.py:192:13: F841 local variable 'e' is assigned to but never used
ihatemoney/utils.py:26:8: W605 invalid escape sequence '\w'
ihatemoney/utils.py:26:10: W605 invalid escape sequence '\s'
ihatemoney/utils.py:27:8: W605 invalid escape sequence '\s'
This commit is contained in:
Jocelyn Delalande 2018-11-25 21:27:04 +01:00
parent 04ad5de811
commit d4729880dd
2 changed files with 3 additions and 3 deletions

View file

@ -189,7 +189,7 @@ class InviteForm(FlaskForm):
for email in [email.strip() for email in form.emails.data.split(",")]: for email in [email.strip() for email in form.emails.data.split(",")]:
try: try:
email_validator.validate_email(email) email_validator.validate_email(email)
except email_validator.EmailNotValidError as e: except email_validator.EmailNotValidError:
raise ValidationError(_("The email %(email)s is not valid", raise ValidationError(_("The email %(email)s is not valid",
email=email)) email=email))

View file

@ -23,8 +23,8 @@ def slugify(value):
value = unicodedata.normalize('NFKD', value) value = unicodedata.normalize('NFKD', value)
if six.PY2: if six.PY2:
value = value.encode('ascii', 'ignore') value = value.encode('ascii', 'ignore')
value = six.text_type(re.sub('[^\w\s-]', '', value).strip().lower()) value = six.text_type(re.sub(r'[^\w\s-]', '', value).strip().lower())
return re.sub('[-\s]+', '-', value) return re.sub(r'[-\s]+', '-', value)
class Redirect303(HTTPException, RoutingException): class Redirect303(HTTPException, RoutingException):