2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-21 06:16:29 +00:00

Merge remote-tracking branch 'inventree/master' into batch-reports

# Conflicts:
#	InvenTree/templates/stock_table.html
This commit is contained in:
Oliver Walters
2021-01-18 23:23:58 +11:00
28 changed files with 2265 additions and 1235 deletions

View File

@ -145,3 +145,22 @@ def get_color_theme_css(username):
inventree_css_static_url = os.path.join(settings.STATIC_URL, inventree_css_sheet)
return inventree_css_static_url
@register.simple_tag()
def authorized_owners(group):
""" Return authorized owners """
owners = []
try:
for owner in group.get_related_owners(include_group=True):
owners.append(owner.owner)
except AttributeError:
# group is None
pass
except TypeError:
# group.get_users returns None
pass
return owners