Commit 70f1dc5b authored by Katia Saurfelt's avatar Katia Saurfelt
Browse files

[flake8] make it pass

parent f3bd04d4adf6
......@@ -25,6 +25,7 @@ classifiers = [
__depends__ = {
'cubicweb': '>= 3.24.0',
'six': '>= 1.4.0',
'cubicweb-forgotpwd': None,
'Pillow': None,
'pycrypto': None,
......
......@@ -25,10 +25,8 @@ from cubicweb.web import controller, form, captcha
from cubicweb.web import formwidgets as fw, formfields as ff
from cubicweb.web.views import forms, basecomponents, urlrewrite
try:
from cubicweb import _
except ImportError:
_ = unicode
from six import text_type as unicode
from cubicweb import _
def qname(attr):
......@@ -143,7 +141,7 @@ class RegistrationConfirmController(controller.Controller):
req.vreg.config['registration-cypher-seed'])
login = data[qname('login')]
password = data.pop(qname('upassword'))
except:
except Exception:
msg = req._(u'Invalid registration data. Please try registering again.')
raise Redirect(req.build_url(u'register', __message=msg))
if self._cw.user.login == login:
......@@ -159,7 +157,7 @@ class RegistrationConfirmController(controller.Controller):
firstname=data.get(qname('firstname')),
surname=data.get(qname('surname')))
cnx.commit()
except ValidationError, err:
except ValidationError as err:
if 'login' in err.errors and 'unicity constraint' in err.errors['login']:
err.errors.pop('', None)
err.errors.pop('login', None)
......@@ -180,7 +178,7 @@ class RegistrationConfirmController(controller.Controller):
with cnx:
name = cnx.user.name()
raise Redirect(self.success_redirect_url(name))
except:
except Exception:
if err is not None:
# both registration and login failed, re-raise the previous
# ValidationError
......
......@@ -14,6 +14,7 @@ Depends:
cubicweb-forgotpwd,
python-imaging,
python-crypto,
python-six (>= 1.4.0),
${python:Depends},
${misc:Depends},
Description: public registration component for the CubicWeb framework
......
......@@ -16,9 +16,10 @@ deps =
commands = flake8 {posargs:{toxinidir}}
[flake8]
format = pylint
ignore = W503, E203, E731, E231
max-line-length = 100
exclude = migration,setup.py,uiprops.py,.tox,doc,scripts
ignore = W503
exclude = cubicweb_registration/migration/*,docs/*,.tox/*,./test/data/*
[pytest]
python_files = *test_*.py
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment