|
1 | 1 | from collections.abc import Sequence |
2 | 2 | from datetime import datetime |
3 | 3 |
|
4 | | -from bcsd_api.global_.exception import BadRequest, Conflict, Forbidden, NotFound |
5 | | -from bcsd_api.domain.form.repository import PgFormRepository, PgQuestionRepository |
6 | 4 | from bcsd_api.common.id_gen import generate_id |
| 5 | +from bcsd_api.common.timezone import KST |
| 6 | +from bcsd_api.domain.form.repository import PgFormRepository, PgQuestionRepository |
7 | 7 | from bcsd_api.domain.member.repository import PgMemberRepository |
8 | 8 | from bcsd_api.domain.setting.repository import PgSettingRepository |
9 | | -from bcsd_api.common.timezone import KST |
10 | | - |
11 | | -from .repository import PgAnswerRepository, PgApplicationRepository |
| 9 | +from bcsd_api.global_.exception import BadRequest, Conflict, Forbidden, NotFound |
12 | 10 | from .model import ( |
13 | 11 | AnswerRequest, |
14 | 12 | AnswerResponse, |
15 | 13 | ApplicationListResponse, |
16 | 14 | MyApplicationResponse, |
17 | 15 | PaymentInfoResponse, |
18 | 16 | ) |
| 17 | +from .repository import PgAnswerRepository, PgApplicationRepository |
19 | 18 |
|
20 | 19 |
|
21 | 20 | def _now() -> str: |
@@ -191,16 +190,15 @@ def approve( |
191 | 190 | return approved |
192 | 191 |
|
193 | 192 |
|
194 | | -_STATUS_RELATION = {"Beginner": "beginner", "Regular": "regular"} |
195 | | - |
196 | | - |
197 | 193 | def _add_org_relation(authz, member_id: str, status: str) -> None: |
198 | 194 | if not authz: |
199 | 195 | return |
200 | | - relation = _STATUS_RELATION.get(status) |
| 196 | + from bcsd_api.common.constants import ORG_ID, STATUS_RELATION |
| 197 | + |
| 198 | + relation = STATUS_RELATION.get(status) |
201 | 199 | if not relation: |
202 | 200 | return |
203 | | - authz.add_relation("organization", "bcsdlab", relation, member_id) |
| 201 | + authz.add_relation("organization", ORG_ID, relation, member_id) |
204 | 202 |
|
205 | 203 |
|
206 | 204 | def cancel( |
|
0 commit comments