Skip to content

Commit

Permalink
YDA-5625: add automatic labels to SRAM CO
Browse files Browse the repository at this point in the history
Co-authored-by: Lazlo Westerhof <[email protected]>
  • Loading branch information
kaur16 and lwesterhof authored Mar 22, 2024
1 parent 6e31692 commit 3da4a93
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion sram.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ def sram_post_collaboration(ctx, group_name, description):
url = "{}/api/collaborations/v1".format(config.sram_rest_api_url)
headers = {'Content-Type': 'application/json', 'charset': 'UTF-8', 'Authorization': 'bearer ' + config.sram_api_key}

group_type = ''
if group_name.split('-')[0] in ('research', 'datamanager', 'priv', 'deposit'):
group_type = group_name.split('-')[0]

disable_join_requests = True
if config.sram_flow == 'join_request':
disable_join_requests = False
Expand All @@ -38,7 +42,8 @@ def sram_post_collaboration(ctx, group_name, description):
"disclose_member_information": True,
"disclose_email_information": True,
"administrators": [session_vars.get_map(ctx.rei)["client_user"]["user_name"]],
"logo": config.sram_co_logo_url
"logo": config.sram_co_logo_url,
"tags": [config.sram_co_default_label, group_type]
}

if config.sram_verbose_logging:
Expand Down
1 change: 1 addition & 0 deletions util/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ def __repr__(self):
sram_flow=None,
sram_verbose_logging=False,
sram_tls_verify=True,
sram_co_default_label=None,
sram_co_logo_url=None,
arb_enabled=False,
arb_exempt_resources=[],
Expand Down

0 comments on commit 3da4a93

Please sign in to comment.