Skip to content

Commit

Permalink
ProposalResource: remove default str fallback logic (#1772)
Browse files Browse the repository at this point in the history
* ProposalResource: remove default `str` fallback logic

* Tests: fixup: update test expectation

---------

Co-authored-by: Russ Garrett <russ@garrett.co.uk>
  • Loading branch information
jayaddison and russss authored Sep 1, 2024
1 parent 2d909d2 commit 8911c4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/api/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,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()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api_proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 8911c4e

Please sign in to comment.