Skip to content
Snippets Groups Projects
Commit 8a802abc authored by Alexander Kaschta's avatar Alexander Kaschta :owl:
Browse files

ADD: BCD request devel warning

parent 45a925f2
No related branches found
No related tags found
No related merge requests found
Pipeline #420141 passed
......@@ -23,6 +23,14 @@ js_mods = ['bcdrequest']
async def handle_request(bcd_request: BCDRequestModel, token: APIToken = Depends(check_auth), conn=Depends(get_conn)):
user = Mgr.check_token(conn, token)
host_is_prod = db.host_omdl.OP_ENV_IS_PROD
if not host_is_prod and not user.has_permission(conn, 'wapi.devel_versions_user'):
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail='This is the development site! '
'Please use patch request on the production site (https://netvs.scc.kit.edu)'
)
ou_request = execute_wapi_function(conn, [
{"idx": "own_mgr2ou_list", "name": "cntl.mgr2ou.list", "old": {"is_own": True}},
{"idx": "unit_list", "name": "org.unit.list", "inner_join_ref": {"own_mgr2ou_list": "default"},
......@@ -242,8 +250,8 @@ def send_bcd_request(bcd_request: BCDRequestModel, mgr: Mgr, receiver=settings.b
host_mode=host_mode,
)
subject = (f'BCD Request for {html.escape(bcd_request.oe)} by {html.escape(mgr.first_name)} '
f'{html.escape(mgr.last_name)}')
subject = (f'BCD Request for {html.escape(bcd_request.oe)} by '
f'{html.escape(mgr.first_name)} {html.escape(mgr.last_name)}')
if host_mode:
subject = f'[{host_mode}] {subject}'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment