Merge branch 'osm' of github.com:jumpserver/jumpserver into osm

This commit is contained in:
ibuler
2026-04-29 16:15:13 +08:00
2 changed files with 3 additions and 1 deletions

View File

@@ -86,6 +86,7 @@ class BaseAccountHandler:
class AssetAccountHandler(BaseAccountHandler):
@staticmethod
def get_filename(name):
name = name.replace('/', '-')
filename = os.path.join(
PATH, f'{name}-{local_now_filename()}-{time.time()}.xlsx'
)

View File

@@ -7,6 +7,7 @@ from django.utils.translation import gettext_lazy as _
from rest_framework.serializers import ValidationError
from common.db.models import JMSBaseModel, CASCADE_SIGNAL_SKIP
from common.exceptions import JMSException
from common.utils import lazyproperty
from orgs.utils import current_org, tmp_to_root_org
from .role import Role
@@ -199,7 +200,7 @@ class OrgRoleBinding(RoleBinding):
if not has_other_role:
error = _('User last role in org, can not be delete, '
'you can remove user from org instead')
raise ValidationError({'error': error})
raise JMSException(code='org_role_delete_error', detail=error)
return super().delete(**kwargs)
class Meta: