From adf31f192250cc86e6fbb4cc49f70119777dbbb1 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Sat, 1 Jun 2024 16:16:02 +0100 Subject: [PATCH 1/3] Add content note and video privacy information to feeds --- apps/schedule/feeds.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/schedule/feeds.py b/apps/schedule/feeds.py index 3144c8e7b..387b467dd 100644 --- a/apps/schedule/feeds.py +++ b/apps/schedule/feeds.py @@ -21,7 +21,14 @@ def _format_event_description(event): - description = event["description"] if event["description"] else "" + description = "" + + if event["content_note"]: + description += "\nCONTENT NOTE: %s" % event["content_note"] + + if event["description"]: + description += "\n\n" + event["description"] + if event["type"] in ["workshop", "youthworkshop"]: description += "\n\nAttending this workshop will cost: " + event["cost"] description += "\nSuitable age range: " + event["age_range"] @@ -35,10 +42,12 @@ def _format_event_description(event): if event["map_link"]: venue_str = f'{venue_str} ({event["map_link"]})' footer_block.append(f'Venue: {venue_str}') + if event["type"] in ("talk", "lightning talk", "performance") and event["video_privacy"] != "public": + footer_block.append(f'This {event["type"]} will not be recorded.') if footer_block: description += '\n\n' + '\n'.join(footer_block) - return description + return description.lstrip('\n') @schedule.route("/schedule/.json") From 637f3d78fd0a631362b01ec16abd48425fa46f91 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Sun, 2 Jun 2024 12:15:37 +0100 Subject: [PATCH 2/3] event["type"] is not a human type --- apps/schedule/feeds.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/schedule/feeds.py b/apps/schedule/feeds.py index 387b467dd..7f6a6da20 100644 --- a/apps/schedule/feeds.py +++ b/apps/schedule/feeds.py @@ -6,7 +6,7 @@ from models import event_year from models.user import User -from models.cfp import Proposal +from models.cfp import Proposal, HUMAN_CFP_TYPES from ..common import feature_flag, feature_enabled, json_response from .schedule_xml import export_frab @@ -42,8 +42,8 @@ def _format_event_description(event): if event["map_link"]: venue_str = f'{venue_str} ({event["map_link"]})' footer_block.append(f'Venue: {venue_str}') - if event["type"] in ("talk", "lightning talk", "performance") and event["video_privacy"] != "public": - footer_block.append(f'This {event["type"]} will not be recorded.') + if event["type"] in ("talk", "lightningtalk", "performance") and event["video_privacy"] != "public": + footer_block.append(f'This {HUMAN_CFP_TYPES[event["type"]]} will not be recorded.') if footer_block: description += '\n\n' + '\n'.join(footer_block) From 6499dbbbe4a5eaf61b7477c113c1d5fc26ddf5e3 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Tue, 4 Jun 2024 16:53:03 +0100 Subject: [PATCH 3/3] Check for video_privacy being none specifically --- apps/schedule/feeds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/schedule/feeds.py b/apps/schedule/feeds.py index 7f6a6da20..b6bea9923 100644 --- a/apps/schedule/feeds.py +++ b/apps/schedule/feeds.py @@ -42,7 +42,7 @@ def _format_event_description(event): if event["map_link"]: venue_str = f'{venue_str} ({event["map_link"]})' footer_block.append(f'Venue: {venue_str}') - if event["type"] in ("talk", "lightningtalk", "performance") and event["video_privacy"] != "public": + if event["type"] in ("talk", "lightningtalk", "performance") and event["video_privacy"] == "none": footer_block.append(f'This {HUMAN_CFP_TYPES[event["type"]]} will not be recorded.') if footer_block: description += '\n\n' + '\n'.join(footer_block)