Skip to content

Commit

Permalink
Allow empty working memo in reservation memo update
Browse files Browse the repository at this point in the history
  • Loading branch information
matti-lamppu committed Feb 13, 2025
1 parent 030fc70 commit 61a124c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,17 @@ def test_reservation__update__working_memo__reserver_staff_user_and_not_own_rese

reservation.refresh_from_db()
assert reservation.working_memo == ""


def test_reservation__update__empty(graphql):
reservation = ReservationFactory.create(working_memo="foo")
graphql.login_with_superuser()

data = {"pk": reservation.pk, "workingMemo": ""}

response = graphql(UPDATE_WORKING_MEMO_MUTATION, input_data=data)

assert response.has_errors is False, response.errors

reservation.refresh_from_db()
assert reservation.working_memo == ""
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ReservationWorkingMemoSerializer(NestingModelSerializer):
"""Update the working memo of a reservation."""

pk = IntegerField(required=True)
working_memo = CharField(required=True, allow_blank=False)
working_memo = CharField(required=True, allow_blank=True)

class Meta:
model = Reservation
Expand Down

0 comments on commit 61a124c

Please sign in to comment.