chore: apply pep8-naming rules for naming convention (#8261)

This commit is contained in:
Bowen Liang
2024-09-11 16:40:52 +08:00
committed by GitHub
parent 53f37a6704
commit 292220c596
95 changed files with 287 additions and 258 deletions

View File

@@ -32,7 +32,7 @@ from services.errors.account import (
NoPermissionError,
RateLimitExceededError,
RoleAlreadyAssignedError,
TenantNotFound,
TenantNotFoundError,
)
from tasks.mail_invite_member_task import send_invite_member_mail_task
from tasks.mail_reset_password_task import send_reset_password_mail_task
@@ -311,13 +311,13 @@ class TenantService:
"""Get tenant by account and add the role"""
tenant = account.current_tenant
if not tenant:
raise TenantNotFound("Tenant not found.")
raise TenantNotFoundError("Tenant not found.")
ta = TenantAccountJoin.query.filter_by(tenant_id=tenant.id, account_id=account.id).first()
if ta:
tenant.role = ta.role
else:
raise TenantNotFound("Tenant not found for the account.")
raise TenantNotFoundError("Tenant not found for the account.")
return tenant
@staticmethod
@@ -614,8 +614,8 @@ class RegisterService:
"email": account.email,
"workspace_id": tenant.id,
}
expiryHours = dify_config.INVITE_EXPIRY_HOURS
redis_client.setex(cls._get_invitation_token_key(token), expiryHours * 60 * 60, json.dumps(invitation_data))
expiry_hours = dify_config.INVITE_EXPIRY_HOURS
redis_client.setex(cls._get_invitation_token_key(token), expiry_hours * 60 * 60, json.dumps(invitation_data))
return token
@classmethod