Skip to content

Commit

Permalink
Merge 710edfa into 358081b
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Oct 19, 2020
2 parents 358081b + 710edfa commit 4aebf60
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 24 deletions.
7 changes: 0 additions & 7 deletions docs/api.rst
Expand Up @@ -52,13 +52,6 @@ Models
:members:


Proxies
-------

.. automodule:: invenio_accounts.proxies
:members:


Utils
-----

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -64,7 +64,7 @@

# Get the version string. Cannot be done with import!
g = {}
with open(os.path.join('..', 'invenio_accounts', 'version.py'), 'rt') as fp:
with open(os.path.join(os.path.dirname(__file__), '..', 'invenio_accounts', 'version.py'), 'rt') as fp:
exec(fp.read(), g)
version = g['__version__']

Expand Down
9 changes: 7 additions & 2 deletions invenio_accounts/views/rest.py
Expand Up @@ -23,6 +23,7 @@
from flask_security.signals import reset_password_instructions_sent
from flask_security.utils import config_value, get_message, login_user, \
logout_user, send_mail, verify_and_update_password
from flask_security.views import logout
from invenio_db import db
from invenio_rest.errors import FieldError, RESTValidationError
from webargs import ValidationError, fields, validate
Expand Down Expand Up @@ -249,7 +250,7 @@ def get(self):
class LogoutView(MethodView):
"""View to logout a user."""

def logout_user(self):
def logout_user_without_post_redirect(self):
"""Perform any logout actions."""
if current_user.is_authenticated:
logout_user()
Expand All @@ -260,9 +261,13 @@ def success_response(self):

def post(self):
"""Logout a user."""
self.logout_user()
self.logout_user_without_post_redirect()
return self.success_response()

def get(self):
"""Logout user."""
return logout()


class RegisterView(MethodView):
"""View to register a new user."""
Expand Down
2 changes: 1 addition & 1 deletion pytest.ini
Expand Up @@ -7,4 +7,4 @@
# under the terms of the MIT License; see LICENSE file for more details.

[pytest]
addopts = --pep8 --ignore=docs --cov=invenio_accounts --cov-report=term-missing
addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_accounts --cov-report=term-missing
13 changes: 6 additions & 7 deletions run-tests.sh
Expand Up @@ -6,10 +6,9 @@
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

pydocstyle invenio_accounts tests docs && \
isort invenio_accounts tests --check-only --diff && \
check-manifest --ignore ".travis-*" && \
sphinx-build -qnNW docs docs/_build/html && \
python setup.py test && \
sphinx-build -qnNW -b doctest docs docs/_build/doctest
python -m check_manifest --ignore ".travis-*" && \
python -m sphinx.cmd.build -qnNW docs docs/_build/html && \
python -m pytest
python -m sphinx.cmd.build -qnNW -b doctest docs docs/_build/doctest
tests_exit_code=$?
exit "$tests_exit_code"
3 changes: 3 additions & 0 deletions setup.cfg
Expand Up @@ -37,3 +37,6 @@ output-dir = invenio_accounts/translations/

[pydocstyle]
add_ignore = D401

[pycodestyle]
exclude = docs/conf.py
9 changes: 3 additions & 6 deletions setup.py
Expand Up @@ -21,10 +21,7 @@
'isort>=4.3.0',
'mock>=2.0.0',
'pydocstyle>=1.0.0',
'pytest-cov>=1.8.0',
'pytest-flask>=0.10.0,<1.0.0',
'pytest-pep8>=1.0.6',
'pytest>=4.0.0,<5.0.0',
'pytest-invenio>=1.4.0',
'selenium>=3.0.1',
]

Expand All @@ -33,7 +30,7 @@
'Flask-Admin>=1.3.0',
],
'docs': [
'Sphinx>=2.4.0,<3',
'Sphinx>=3',
],
'mysql': [
'invenio-db[versioning,mysql]>=1.0.0',
Expand All @@ -56,7 +53,7 @@
extras_require['all'].extend(reqs)

setup_requires = [
'Babel>=1.3',
'Babel>=2.8',
'pytest-runner>=2.6.2',
]

Expand Down

0 comments on commit 4aebf60

Please sign in to comment.