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

@@ -22,7 +22,7 @@ from rest_framework.exceptions import PermissionDenied
from common.db import fields, models as jms_models
from common.utils import (
date_expired_default, get_logger, lazyproperty,
user_date_expired_default, get_logger, lazyproperty,
random_string, bulk_create_with_signal
)
from labels.mixins import LabeledMixin
@@ -868,7 +868,7 @@ class User(AuthMixin, TokenMixin, RoleMixin, MFAMixin, LabeledMixin, JSONFilterM
)
is_first_login = models.BooleanField(default=True, verbose_name=_('Is first login'))
date_expired = models.DateTimeField(
default=date_expired_default, blank=True, null=True,
default=user_date_expired_default, blank=True, null=True,
db_index=True, verbose_name=_('Date expired')
)
created_by = models.CharField(max_length=30, default='', blank=True, verbose_name=_('Created by'))