diff --git a/groups.py b/groups.py index a658dc1ad..a55ffec01 100644 --- a/groups.py +++ b/groups.py @@ -1053,7 +1053,7 @@ def group_create(ctx, group_name, category, subcategory, schema_id, expiration_d # Post SRAM collaboration and connect to service if SRAM is enabled. if config.enable_sram: - response_sram = sram.sram_post_collaboration(ctx, group_name, description, expiration_date) + response_sram = sram.sram_post_collaboration(ctx, group_name, description) if "error" in response_sram: message = response_sram['message'] @@ -1323,14 +1323,13 @@ def rule_group_sram_sync(ctx): members = group['members'] managers = group['managers'] description = group['description'] if 'description' in group else '' - expiration_date = group['expiration_date'] if 'expiration_date' in group else '' log.write(ctx, "Sync group {} with SRAM".format(group_name)) sram_group, co_identifier = sram_enabled(ctx, group_name) # Post collaboration group is not yet already SRAM enabled. if not sram_group: - response_sram = sram.sram_post_collaboration(ctx, group_name, description, expiration_date) + response_sram = sram.sram_post_collaboration(ctx, group_name, description) if "error" in response_sram: message = response_sram['message'] diff --git a/sram.py b/sram.py index 7525e160c..d8f992bcf 100644 --- a/sram.py +++ b/sram.py @@ -14,28 +14,18 @@ from util import * -def sram_post_collaboration(ctx, group_name, description, expiration_date): +def sram_post_collaboration(ctx, group_name, description): """Create SRAM Collaborative Organisation Identifier. :param ctx: Combined type of a callback and rei struct :param group_name: Name of the group to create :param description: Description of the group to create - :param expiration_date: Retention period for the group :returns: JSON object with new collaboration details """ url = "{}/api/collaborations/v1".format(config.sram_rest_api_url) headers = {'Content-Type': 'application/json', 'charset': 'UTF-8', 'Authorization': 'bearer ' + config.sram_api_key} - if expiration_date == '': - # Now plus a year. - expiration_date = datetime.datetime.fromtimestamp(int(time.time() + 3600 * 24 * 365)).strftime('%Y-%m-%d') - - # Get epoch expiry date. - date = datetime.datetime.strptime(expiration_date, "%Y-%m-%d") - epoch = datetime.datetime.utcfromtimestamp(0) - epoch_date = int((date - epoch).total_seconds()) - disable_join_requests = True if config.sram_flow == 'join_request': disable_join_requests = False @@ -47,7 +37,6 @@ def sram_post_collaboration(ctx, group_name, description, expiration_date): "disable_join_requests": disable_join_requests, "disclose_member_information": True, "disclose_email_information": True, - "expiry_date": epoch_date, "administrators": [session_vars.get_map(ctx.rei)["client_user"]["user_name"]] }