管理后台前后端逻辑、UI美化
This commit is contained in:
@@ -24,11 +24,17 @@ async def _validate_site_subject(db: AsyncSession, study_id: uuid.UUID, site_id:
|
||||
site = result.scalar_one_or_none()
|
||||
if not site or site.study_id != study_id:
|
||||
raise ValueError("分中心不属于当前项目")
|
||||
if not site.is_active:
|
||||
raise ValueError("中心已停用")
|
||||
if subject_id:
|
||||
result = await db.execute(select(Subject).where(Subject.id == subject_id))
|
||||
subj = result.scalar_one_or_none()
|
||||
if not subj or subj.study_id != study_id:
|
||||
raise ValueError("参与者不属于当前项目")
|
||||
result = await db.execute(select(Site).where(Site.id == subj.site_id))
|
||||
subj_site = result.scalar_one_or_none()
|
||||
if subj_site and not subj_site.is_active:
|
||||
raise ValueError("中心已停用")
|
||||
|
||||
|
||||
async def create_ae(
|
||||
|
||||
Reference in New Issue
Block a user