Skip to content

Commit

Permalink
Merge pull request #561 from OpenUpSA/fix/question-committee-no-name
Browse files Browse the repository at this point in the history
Fallback for committee question with no asked by name
  • Loading branch information
paulmwatson authored Aug 14, 2024
2 parents 7b16b45 + 5a3cb71 commit 5eac6e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pmg/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,13 +601,17 @@ def committee_question(question_id):
question = load_from_api("v2/minister-questions", question_id)["result"]
minister = question["minister"]
committee = minister.get("committee", {"house": {}, "id": 0})
if question["asked_by_name"]:
asked_by_name = question["asked_by_name"]
else:
asked_by_name = ""
social_summary = (
"A question to the "
+ question["question_to_name"]
+ ", asked on "
+ pretty_date(question["date"], "long")
+ " by "
+ question["asked_by_name"]
+ asked_by_name
)

return render_template(
Expand Down

0 comments on commit 5eac6e9

Please sign in to comment.