#2698 Move admin session time out and ticket checks into a decorator
Closed: Fixed 6 years ago Opened 6 years ago by pingou.

In the repo.py controller we use multiple times the following code:

    if admin_session_timedout():
        flask.flash('Action canceled, try it again', 'error')
        url = flask.url_for(
            'view_settings', username=username, repo=repo,
            namespace=namespace)
        return flask.redirect(
            flask.url_for('auth_login', next=url))

    repo = flask.g.repo

    if not repo.settings.get('issue_tracker', True):
        flask.abort(404, 'No issue tracker found for this project')

    if not flask.g.repo_admin:
        flask.abort(
            403,
            'You are not allowed to change the settings for this project')

We could simplify the code using a decorator or a single utility method.


Metadata Update from @pingou:
- Issue tagged with: RFE

6 years ago

Metadata Update from @pingou:
- Issue assigned to cverna
- Issue close_status updated to: Fixed

6 years ago

Login to comment on this ticket.

Metadata