Skip to content

Commit

Permalink
Remove more unnecessary if else
Browse files Browse the repository at this point in the history
  • Loading branch information
lwesterhof committed Aug 2, 2024
1 parent 23acf5a commit 7398878
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions datarequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2228,8 +2228,7 @@ def datamanager_review_emails(ctx, request_id, datarequest_status):
# Get (source data for) email input parameters
pm_members = group.members(ctx, GROUP_PM)
datamanager_review = json.loads(datarequest_datamanager_review_get(ctx, request_id))
datamanager_remarks = (datamanager_review['datamanager_remarks'] if 'datamanager_remarks' in
datamanager_review else "")
datamanager_remarks = datamanager_review.get('datamanager_remarks', '')
truncated_title = truncated_title_get(ctx, request_id)

# Send emails
Expand Down Expand Up @@ -2302,8 +2301,7 @@ def evaluation_emails(ctx, request_id, datarequest_status):
researcher_email = datarequest_owner_get(ctx, request_id)
cc = cc_email_addresses_get(datarequest['contact'])
evaluation = json.loads(datarequest_evaluation_get(ctx, request_id))
feedback_for_researcher = (evaluation['feedback_for_researcher'] if 'feedback_for_researcher' in
evaluation else "")
feedback_for_researcher = evaluation.get('feedback_for_researcher', '')
pm_email, _ = filter(lambda x: x[0] != "rods", group.members(ctx, GROUP_PM))[0]
truncated_title = truncated_title_get(ctx, request_id)

Expand Down
10 changes: 5 additions & 5 deletions groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,11 +406,11 @@ def api_group_data(ctx):
coll_name = "/{}/home/{}".format(user.zone(ctx), group['name'])

group_hierarchy[group['category']][group['subcategory']][group['name']] = {
'description': group['description'] if 'description' in group else '',
'description': group.get('description', ''),
'schema_id': group['schema_id'],
'expiration_date': group['expiration_date'] if 'expiration_date' in group else '',
'data_classification': group['data_classification'] if 'data_classification' in group else '',
'creation_date': creation_dates[coll_name] if coll_name in creation_dates else '',
'expiration_date': group.get('expiration_date', ''),
'data_classification': group.get('data_classification', ''),
'creation_date': creation_dates.get(coll_name, ''),
'members': members
}

Expand Down Expand Up @@ -1199,7 +1199,7 @@ def rule_group_sram_sync(ctx):
group_name = group["name"]
members = group['members'] + group['read']
managers = group['managers']
description = group['description'] if 'description' in group else ''
description = group.get('description', '')

log.write(ctx, "Sync group {} with SRAM".format(group_name))

Expand Down

0 comments on commit 7398878

Please sign in to comment.