mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-19 19:59:10 +08:00
fix: invoke-email
This commit is contained in:
parent
77a62f33b3
commit
632b2bac2a
@ -10,6 +10,7 @@ from typing import Any, Optional
|
|||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from sqlalchemy import func
|
from sqlalchemy import func
|
||||||
|
from sqlalchemy.orm import Session
|
||||||
from werkzeug.exceptions import Unauthorized
|
from werkzeug.exceptions import Unauthorized
|
||||||
|
|
||||||
from configs import dify_config
|
from configs import dify_config
|
||||||
@ -828,10 +829,11 @@ class RegisterService:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def invite_new_member(
|
def invite_new_member(
|
||||||
cls, tenant: Tenant, email: str, language: str, role: str = "normal", inviter: Account = None
|
cls, tenant: Tenant, email: str, language: str, role: str = "normal", inviter: Account | None = None
|
||||||
) -> str:
|
) -> str:
|
||||||
"""Invite new member"""
|
"""Invite new member"""
|
||||||
account = Account.query.filter_by(email=email).first()
|
with Session(db.engine) as session:
|
||||||
|
account = session.query(Account).filter_by(email=email).first()
|
||||||
|
|
||||||
if not account:
|
if not account:
|
||||||
TenantService.check_member_permission(tenant, inviter, None, "add")
|
TenantService.check_member_permission(tenant, inviter, None, "add")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user