Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Role referenced before assignment #11

Open
LincolnBryant opened this issue Nov 13, 2023 · 0 comments
Open

Role referenced before assignment #11

LincolnBryant opened this issue Nov 13, 2023 · 0 comments

Comments

@LincolnBryant
Copy link
Contributor

2023-11-13 10:37:24,260;app;log_exception;ERROR;Exception on /jupyterlab [GET]
Traceback (most recent call last):
  File "/usr/local/af-portal/venv/lib64/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/af-portal/venv/lib64/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/af-portal/venv/lib64/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/af-portal/venv/lib64/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "./portal/decorators.py", line 176, in inner
    return render_template('request_membership.html', role=role)
UnboundLocalError: local variable 'role' referenced before assignment

Seems to be because the role variable only exists in the scope of the if profile block here: https://github.com/maniaclab/af-portal/blob/main/portal/decorators.py#L160-L177

Probably we should render a page telling the user there was a problem getting profile information in that case, and ask them to try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant