File: utils.py

package info (click to toggle)
django-stronghold 0.4.0%2Bdebian-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 208 kB
  • sloc: python: 413; makefile: 135
file content (13 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
def is_view_func_public(func):
    """
    Returns whether a view is public or not (ie/ has the STRONGHOLD_IS_PUBLIC
    attribute set)
    """
    return getattr(func, "STRONGHOLD_IS_PUBLIC", False)


def set_view_func_public(func):
    """
    Set the STRONGHOLD_IS_PUBLIC attribute on a given function to True
    """
    setattr(func, "STRONGHOLD_IS_PUBLIC", True)