diff --git a/ihatemoney/forms.py b/ihatemoney/forms.py index de9004d5..e8d437bf 100644 --- a/ihatemoney/forms.py +++ b/ihatemoney/forms.py @@ -189,7 +189,7 @@ class InviteForm(FlaskForm): for email in [email.strip() for email in form.emails.data.split(",")]: try: email_validator.validate_email(email) - except email_validator.EmailNotValidError as e: + except email_validator.EmailNotValidError: raise ValidationError(_("The email %(email)s is not valid", email=email)) diff --git a/ihatemoney/utils.py b/ihatemoney/utils.py index d03e91bf..19340df8 100644 --- a/ihatemoney/utils.py +++ b/ihatemoney/utils.py @@ -23,8 +23,8 @@ def slugify(value): value = unicodedata.normalize('NFKD', value) if six.PY2: value = value.encode('ascii', 'ignore') - value = six.text_type(re.sub('[^\w\s-]', '', value).strip().lower()) - return re.sub('[-\s]+', '-', value) + value = six.text_type(re.sub(r'[^\w\s-]', '', value).strip().lower()) + return re.sub(r'[-\s]+', '-', value) class Redirect303(HTTPException, RoutingException):