Some bookings become uneditable/undeletable

Issue #42 resolved
Justin Hayes repo owner created an issue

Sometimes bookings are getting into a state where the creator or admins can't edit or delete them.

If you click on the booking the popup comes up empty, rather than showing the correct booking details.

Comments (4)

  1. Justin Hayes reporter

    Looks like the bookings are somehow getting a value of status 'o', which should be impossible:

    #!
    mysql> select * from booking where booking_id = 4515;
    +------------+-----------+--------+---------------------+---------------------+---------+-------+---------------------+------------+---------------------+------------+
    | booking_id | object_id | status | start               | end                 | user_id | notes | created             | created_by | updated             | updated_by |
    +------------+-----------+--------+---------------------+---------------------+---------+-------+---------------------+------------+---------------------+------------+
    |       4515 |         1 | o      | 2013-06-25 11:00:00 | 2013-06-25 14:00:00 |      68 |       | 2013-06-21 13:53:08 |         68 | 2013-06-22 07:01:23 |         12 |
    +------------+-----------+--------+---------------------+---------------------+---------+-------+---------------------+------------+---------------------+------------+
    1 row in set (0.00 sec)
    
    mysql> select distinct(status) from booking;
    +--------+
    | status |
    +--------+
    | Y      |
    | X      |
    | N      |
    | o      |
    +--------+
    4 rows in set (0.01 sec)
    
    mysql> select count(*) from booking where status = 'o';
    +----------+
    | count(*) |
    +----------+
    |        6 |
    +----------+
    1 row in set (0.01 sec)
    
  2. Justin Hayes reporter

    Easiest thing to do for now would be to put some validation in to check that status is Y/N/X and throw an error back to the client if not.

  3. Log in to comment