From 705f891bbeecba1eb5d6b45e95f6bcea6a9ce13a Mon Sep 17 00:00:00 2001 From: James Addison Date: Sat, 31 Aug 2024 19:26:13 +0100 Subject: [PATCH 1/2] ProposalResource: remove default `str` fallback logic --- apps/api/schedule.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api/schedule.py b/apps/api/schedule.py index f775d8d72..a85046119 100644 --- a/apps/api/schedule.py +++ b/apps/api/schedule.py @@ -52,7 +52,7 @@ def patch(self, proposal_id): for attribute in ALLOWED_ATTRIBUTES: if attribute in payload: - setattr(proposal, attribute, payload[attribute] or "") + setattr(proposal, attribute, payload[attribute]) db.session.add(proposal) db.session.commit() From 37f301c283cf1d9bc74f778269b479ef4798be18 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sat, 31 Aug 2024 19:52:15 +0100 Subject: [PATCH 2/2] Tests: fixup: update test expectation --- tests/test_api_proposals.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_api_proposals.py b/tests/test_api_proposals.py index a88692a99..757a97faa 100644 --- a/tests/test_api_proposals.py +++ b/tests/test_api_proposals.py @@ -83,7 +83,7 @@ def test_clearing_video_url(client, app, db, proposal): assert rv.status_code == 200 proposal = Proposal.query.get(proposal.id) - assert proposal.youtube_url == "" + assert proposal.youtube_url is None def test_rejects_disallowed_attributes(client, app, proposal):