Skip to content

Commit

Permalink
Merge pull request ome#5759 from will-moore/check_PUBLIC_ENABLED_befo…
Browse files Browse the repository at this point in the history
…re_redirect

Check PUBLIC_ENABLED before redirect
  • Loading branch information
sbesson authored Jul 3, 2018
2 parents 846afb1 + 0d7aec9 commit 26aa17c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/tools/OmeroWeb/omeroweb/webclient/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ def _load_template(request, menu, conn=None, url=None, **kwargs):
# If we failed to find 'show'...
if request.GET.get('show', None) is not None and first_sel is None:
# and we're logged in as PUBLIC user...
if settings.PUBLIC_USER == conn.getUser().getOmeName():
if (settings.PUBLIC_ENABLED and
settings.PUBLIC_USER == conn.getUser().getOmeName()):
# this is likely a regular user who needs to log in as themselves.
# Login then redirect to current url
return HttpResponseRedirect(
Expand Down

0 comments on commit 26aa17c

Please sign in to comment.