mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Apply suggestions from code review
Thank you Marius! way better :) Co-authored-by: Marius van den Beek <m.vandenbeek@gmail.com>
This commit is contained in:
co-authored by
Marius van den Beek
parent
eab03a0f97
commit
e34546aec7
@@ -250,17 +250,13 @@ class ProvidesUserFileSourcesUserContext:
|
||||
def role_names(self) -> Set[str]:
|
||||
"""The set of role names of this user."""
|
||||
user = self.trans.user
|
||||
if user is None:
|
||||
return set()
|
||||
return user and set([ura.role.name for ura in user.roles])
|
||||
return set(ura.role.name for ura in user.roles) if user else set()
|
||||
|
||||
@property
|
||||
def group_names(self) -> Set[str]:
|
||||
"""The set of group names to which this user belongs."""
|
||||
user = self.trans.user
|
||||
if user is None:
|
||||
return set()
|
||||
return user and set([ugr.group.name for ugr in user.groups])
|
||||
return set(ugr.group.name for ugr in user.groups) if user else set()
|
||||
|
||||
@property
|
||||
def is_admin(self):
|
||||
|
||||
Reference in New Issue
Block a user