feat: Set the default expiration days for adding user and asset permissions

This commit is contained in:
ewall555
2025-05-09 17:21:27 +08:00
committed by 老广
parent f4f74909a8
commit 48239b0c63
6 changed files with 25 additions and 5 deletions

View File

@@ -51,6 +51,19 @@ def date_expired_default():
years = 70
return timezone.now() + timezone.timedelta(days=365 * years)
def user_date_expired_default():
try:
days = int(settings.USER_DEFAULT_EXPIRED_DAYS)
except TypeError:
days = 25550
return timezone.now() + timezone.timedelta(days=days)
def asset_permission_date_expired_default():
try:
days = int(settings.ASSET_PERMISSION_DEFAULT_EXPIRED_DAYS)
except TypeError:
days = 25550
return timezone.now() + timezone.timedelta(days=days)
def union_queryset(*args, base_queryset=None):
if len(args) == 1: