Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add content note and video privacy information to feeds #1719

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions apps/schedule/feeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
Expand All @@ -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", "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)

return description
return description.lstrip('\n')


@schedule.route("/schedule/<int:year>.json")
Expand Down