diff --git a/lib/galaxy/webapps/galaxy/controllers/admin.py b/lib/galaxy/webapps/galaxy/controllers/admin.py index a2558aaf474..8251c598062 100644 --- a/lib/galaxy/webapps/galaxy/controllers/admin.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin.py @@ -801,7 +801,7 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP return trans.show_error_message("User impersonation is not enabled in this instance of Galaxy.") message = '' status = 'done' - emails = None + show_emails = True user = None user_id = kwd.get('id', None) if user_id is not None: @@ -812,13 +812,11 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP trans.handle_user_logout() trans.handle_user_login(user) message = 'You are now logged in as %s, return to the home page' % (user.email, url_for(controller='root')) - emails = [] + show_emails = False elif user_id or email: message = 'Invalid user selected' status = 'error' - if emails is None: - emails = [u.email for u in trans.sa_session.query(trans.app.model.User).enable_eagerloads(False).all()] - return trans.fill_template('admin/impersonate.mako', emails=emails, message=message, status=status) + return trans.fill_template('admin/impersonate.mako', show_emails=show_emails, message=message, status=status) def check_for_tool_dependencies(self, trans, migration_stage): # Get the 000x_tools.xml file associated with migration_stage. diff --git a/templates/admin/impersonate.mako b/templates/admin/impersonate.mako index 915b93107f5..969aeabdee7 100644 --- a/templates/admin/impersonate.mako +++ b/templates/admin/impersonate.mako @@ -5,7 +5,7 @@ ${render_msg( message, status )} %endif -%if emails: +%if show_emails:
Impersonate another user