Skip to content

Commit

Permalink
Cleanup tags (#8712)
Browse files Browse the repository at this point in the history
* Remove part_allocation_count tag

* Remove more dead tags
  • Loading branch information
SchrodingersGat authored Dec 18, 2024
1 parent e37e723 commit 88bfb23
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/backend/InvenTree/InvenTree/templatetags/inventree_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,35 +118,6 @@ def to_list(*args):
return args


@register.simple_tag()
def part_allocation_count(build, part, *args, **kwargs):
"""Return the total number of <part> allocated to <build>."""
return InvenTree.helpers.decimal2string(build.getAllocatedQuantity(part))


@register.simple_tag()
def inventree_in_debug_mode(*args, **kwargs):
"""Return True if the server is running in DEBUG mode."""
return djangosettings.DEBUG


@register.simple_tag()
def inventree_show_about(user, *args, **kwargs):
"""Return True if the about modal should be shown."""
if get_global_setting('INVENTREE_RESTRICT_ABOUT'):
# Return False if the user is not a superuser, or no user information is provided
if not user or not user.is_superuser:
return False

return True


@register.simple_tag()
def inventree_docker_mode(*args, **kwargs):
"""Return True if the server is running as a Docker image."""
return djangosettings.DOCKER


@register.simple_tag()
def plugins_enabled(*args, **kwargs):
"""Return True if plugins are enabled for the server instance."""
Expand Down

0 comments on commit 88bfb23

Please sign in to comment.