Coverage for users/constants.py: 100%
9 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-10 18:35 +0000
1import string
3from django.db.models import Q
5OBJECTPERMISSION_OBJECT_TYPES = (
6 (Q(public=True) & ~Q(app_label='core', model='objecttype'))
7 | Q(app_label='core', model__in=['managedfile'])
8 | Q(app_label='extras', model__in=['scriptmodule', 'taggeditem'])
9)
11CONSTRAINT_TOKEN_USER = '$user'
13# Django's four default model permissions. These receive special handling
14# (dedicated checkboxes, model properties) and should not be registered
15# as custom model actions.
16RESERVED_ACTIONS = ('view', 'add', 'change', 'delete')
18# API tokens
19TOKEN_PREFIX = 'nbt_' # Used for v2 tokens only
20TOKEN_KEY_LENGTH = 12
21TOKEN_DEFAULT_LENGTH = 40
22TOKEN_CHARSET = string.ascii_letters + string.digits