Skip to content

Commit

Permalink
Drop emails query we weren't actually even using...
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed May 18, 2018
1 parent 6e78a44 commit 96b4532
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions lib/galaxy/webapps/galaxy/controllers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ def impersonate(self, trans, email=None, **kwd):
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:
Expand All @@ -812,13 +812,11 @@ def impersonate(self, trans, email=None, **kwd):
trans.handle_user_logout()
trans.handle_user_login(user)
message = 'You are now logged in as %s, <a target="_top" href="%s">return to the home page</a>' % (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.
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/impersonate.mako
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
${render_msg( message, status )}
%endif

%if emails:
%if show_emails:
<div class="toolForm">
<div class="toolFormTitle">Impersonate another user</div>
<div class="toolFormBody">
Expand Down

0 comments on commit 96b4532

Please sign in to comment.