Skip to content

Conversation

@moliholy
Copy link
Contributor

@moliholy moliholy commented Jan 30, 2024

Closes #6150

Room booking: reason required configuration

This PR allows to set a configuration parameter to determine whether specifying a reason for a booking is mandatory or not.

Screenshots

Screenshot 2024-01-30 at 02 06 36

@moliholy moliholy force-pushed the booking-reason-required branch from 876d622 to 400685b Compare February 1, 2024 19:25
@moliholy moliholy marked this pull request as ready for review February 1, 2024 19:27
@moliholy
Copy link
Contributor Author

moliholy commented Feb 1, 2024

@ThiefMaster ready for review!

@ThiefMaster
Copy link
Member

ThiefMaster commented Feb 9, 2024

Some issues I noticed while testing:

  • There's an empty "Booking reason" box when viewing a booking. I already pushed a fix for this.
  • When the reason is optional and you start entering a reason and delete it again, creating the booking fails, because we send '' instead of omitting the field. I already pushed a fix for this.
  • There's no server-side enforcement of this setting. Not really a big problem considering one could simply put xyz or whatever in the reason. Still better if you could fix it.
  • When editing a booking, the reason field is still always required. The behavior there should match the one we have when creating a new booking.

@moliholy
Copy link
Contributor Author

moliholy commented Feb 9, 2024

@ThiefMaster

There's no server-side enforcement of this setting. Not really a big problem considering one could simply put xyz or whatever in the reason. Still better if you could fix it.
When editing a booking, the reason field is still always required. The behavior there should match the one we have when creating a new booking.

Both of them are now addressed.

@moliholy moliholy force-pushed the booking-reason-required branch from 044ad95 to e447479 Compare February 12, 2024 11:31
@ThiefMaster
Copy link
Member

Needs a changelog entry :)

- Add setting to configure whether room bookings require a reason (:issue:`6150`, :pr:`6155`,
  thanks :user:`Moliholy, unconventionaldotdev`)

@moliholy
Copy link
Contributor Author

Needs a changelog entry :)

Added 😄

@ThiefMaster ThiefMaster force-pushed the booking-reason-required branch from 7ca46ed to 3108451 Compare February 12, 2024 14:17
During creation we filter it out, but during edit this must be done
manually to get a nicer validation error instead of "field cannot be
null"
We always pass something from the selector
@ThiefMaster ThiefMaster added this to the v3.3 milestone Feb 12, 2024
@ThiefMaster ThiefMaster merged commit b43fa66 into indico:master Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make the reason for booking a room optional

2 participants