Room booking lets the association publish the rooms it lends out and lets anyone see them and book one. The room list and each room’s page are open to visitors. People who have an account on the website can book straight away; people who do not must unlock the booking form with a shared code. Upcoming bookings also appear in a block on the front page. The board manages the rooms, the bookings and the code in the Django admin.
/admin. The list shows each room’s name, its bookable hours, its current booking code and how many bookings it has. Use the search box to find a room by name.The room name and the description are public. The list shows the first 30 words of the description and the room page shows all of it, so do not put internal notes there.
There is no on/off switch for a room: while the row exists, the room is on the public list and its page is reachable. To take a room off the site, delete it, which deletes its bookings with it, so do that only when the room and its history should really be gone. To stop bookings for a while, close a period instead, which leaves the room and its history alone.
Leave Bokningsbart från and Bokningsbart till empty and the room can be booked around the clock, which is the default and what most rooms want. Fill both in to keep bookings inside a daily window: a room with 08:00 and 22:00 refuses a booking that starts at 03:00, one that ends after 22:00, and one that runs from one day into the next through the closed night. A room that should be bookable across days should leave the hours empty. Setting only one of the two is refused.
Open a room and use the Stängda perioder table on its page, or Booking › Stängda perioder in the sidebar to see them all at once, filtered by room. Give a closure a start, an end, and optionally a Beskrivning, which is shown to visitors, such as “Renovering” or “Bokat av styrelsen”.
A closure blocks new bookings in that period and is listed on the room’s public page, so a visitor sees why the room is unavailable instead of filling in the form and being refused. The message they get is “Utrymmet är stängt under en del av den tiden.”.
A closure does not touch bookings that were already made inside it. Closing a period because something is happening to the room is not the same as cancelling what somebody booked, and the site will not delete a booker’s row for you. Check the room’s booking table before closing a period, and contact anyone affected: the booking stays in the list and on the public page until you delete it yourself.
Replacing a booking in one save does not work. If you delete one booking and add another that would overlap it, or swap two bookings between slots, the save is refused even though the end result would be valid: each row is checked against what is still in the database before the deletion is applied. Delete and save first, then add the replacement.
A booking may run for at most one week. A longer one is refused with “En bokning kan vara i högst en vecka.”. There is no limit on how far ahead a room may be booked.
Open Booking › Bokningar. The list opens furthest away first, so the rows at the top are the bookings still to come and the history sits below them. It has these columns:
On the public pages each booking shows as a weekday and a date (mån 4.10), with the year added when the booking falls in another year than the current one, so a short badge can never be read as the wrong year. The row also shows the booking’s Titel, which is the part of the booking written for those pages.
Filters are available by booking origin, by room and by start date, the date drill-down at the top steps through the calendar, and the search box looks in the booking title, the booker’s name, the booker’s email and the booking description. The origin filter has three choices:
The last two choices are read from the account and the address, not from a stored marker, so a booking the board entered by hand with no account and an address lands under Bokning utan konto, via webbformuläret even though nobody filled in the public form. Treat the filter as a way to narrow the list, not as proof of where a booking came from.
Open a booking to change it. All fields can be edited: Utrymme, Bokare (the member account, optional), Namn, E-post, Starttid, Sluttid, Titel and Beskrivning. The creation timestamp (Skapad) is read-only. Titel is required for a new booking; a booking made before the field existed may keep it empty, so correcting an old row does not force you to invent one.
Titel is what the booking is about, and it is public: the room list, the room page and the front-page block show it. Beskrivning is the longer note for the board. It is shown on the public form with a note that only the board sees it, it is not shown in the public lists, and the booker can read it again in the edit form the cancellation code opens.
The room page carries a table of that room’s upcoming bookings, soonest first, so a booking can be added or adjusted without leaving the room. Past bookings are not listed there, because a room collects them for years; use Booking › Bokningar for those, where the room filter and the date drill-down reach them.
What is public and what is not:
If the member account behind a booking is later deleted, the booking itself stays, and it keeps showing the name that was recorded when it was made.
Every room has its own code. That is the point of them being separate: the code for the sauna says nothing about the office, a room you lend to an outside group can have a code those people never see for the rest of the house, and a code that leaks is contained to the room it leaked from.
A room’s code does not change by itself. It stays exactly as it is until someone with the booking permissions rotates it, so there is no schedule to keep an eye on and no moment of the month when bookers are suddenly locked out.
Open Booking › Utrymmen. The list shows each room’s Aktuell bokningskod and when it was last rotated (Senast bytt, or Aldrig). Opening a room shows the same two things under Bokningskod.
The codes are generated by the site from its own secret, the room and a counter. They cannot be typed in, chosen, copied from anywhere else, or edited, and there is no field for them. The site never stores a code itself, so there is nothing to reveal or reset.
A booking’s cancellation code is a credential for that booking, not for the room. While the booking is in the future, someone holding it can change the title and time without the room code or a captcha, as often as they like. Once the booking has started they can still change the title and description, but not the time. Once it has ended, the code page no longer finds it. Rotating the room code does not stop any of this, because the cancellation code is derived from the booking itself. Anyone the confirmation email is forwarded to can do the same. To end that access, cancel the booking.
Only someone who may change rooms is offered the action.
The previous code keeps working for 15 minutes after a rotation, counted from the moment you rotated it, so a booker who was handed the code just before you rotated is not stranded. Someone who had already typed the old code loses that unlock at once and is asked for a code again, but typing the old code during those 15 minutes works and unlocks them for the new code, so nobody has to be chased up. Rotating one room leaves every other room’s codes and unlocks exactly as they were.
Nothing rotates a code on a schedule, and nothing warns you that a code is old. Senast bytt is the only signal, so a board that wants the codes to move regularly has to remember to move them. A code that is never rotated stays valid indefinitely, which is why the captcha and the five-attempt limit carry the weight they do; the developer guide says how far those reach.
The board shares the current code with outside bookers through whatever channel it already uses, for example at the office, by phone, in a group chat or by email. The site does not send the code to anyone, and it deliberately does not say how the code reaches a booker, because that is the board’s business rather than the website’s.
The website does explain the rest. The room list says that an account books directly and that everyone else needs a code, and the page that asks for the code says that the board provides it.
Så får besökare koden on Booking › Bokningsinställningar is where the board writes its own sentence for that page, if the standard text does not fit: “koden delas ut i kansliet på onsdagar”, “fråga i Slackkanalen”, or whatever the board actually does. It is shown on the page that asks for a code, above the box, and it is the same sentence for every room. Leave it empty and the page says only that the board provides the code. The text is public, so do not put anything there that bookers should not read. It is written once per association and is not translated, the same as a room’s name and description.
Whoever is asked for the code always has a way to reach the board: the association address is in the footer of every page, and the code page and the room page repeat it. The confirmation email carries it too, so a booker whose plans change knows where to turn.
A booker who has unlocked the form stays unlocked for the rest of the current period. When the code rotates, every existing unlock ends, and the next visit asks for a code again. If the booker already has the previous code, it still works during the grace period described above.
The room list is linked from the booking block on the front page. To put it in the site menu as well, add a page under Static Pages with the URL /booking/ and place it through Page Navigation. The path is the same in every language, because the website keeps the language in a cookie rather than in the address.
Access to the booking section is controlled by the ordinary Django model permissions. A staff group does not get booking access by being a staff group; the permissions have to be granted deliberately to each group that should have them.
The permissions to grant, by model, with the exact codenames as they appear in the group permission list:
booking.view_roombooking.add_roombooking.change_roombooking.delete_roombooking.view_bookingbooking.add_bookingbooking.change_bookingbooking.delete_bookingbooking.view_closurebooking.add_closurebooking.change_closurebooking.delete_closurebooking.view_closure is what makes the table appear, and it is enough to read it. Adding a period needs add_closure, and changing or removing one needs change_closure and delete_closure. Without any view permission the table is hidden entirely, so a board that may edit rooms but not see closures gets no explanation of why a period is closed.booking.view_bookingsettingsbooking.change_bookingsettingsbooking.add_bookingsettings is needed once, to create the row: nothing else creates it, and the site deliberately does not, so without it the board cannot write its note. booking.delete_bookingsettings is never needed, because the admin refuses to delete the row.Who should have them:
styrelse) should have all of the permissions above, so the board can manage rooms, bookings, closures and the codes. members/provisioning.py grants a group every permission of every local app, so a group provisioned that way picks the closure permissions up on its next run and nothing has to be added by hand.fotograf) and vote counters (rösträknare), must not. With these permissions a group could change rooms, delete other people’s bookings, or look up the email addresses of outside bookers.booking.view_bookingsettings to whoever writes the note that visitors read. It no longer shows a code: the codes live on the rooms, so the permission that shows them is booking.view_room.How to grant them: open the group on the Grupper (Groups) page in the admin’s authentication section, move the booking permissions from the available list to the chosen list, and save. Granting a permission is what makes the booking section appear for that group; no other step is needed. A group without any of these permissions sees no booking section at all in the admin. Superusers always have access.
An outside booker says the code is rejected.
A room is missing from the public list.
You saved a booking and were told it had been removed.
A booking was rejected because the room is closed.
A booking was rejected because it was too long.
A booking was rejected as overlapping.
A booking was rejected because of the times or the name.
A booking is missing from the room page but you know it exists.
The booking section is not in the admin menu.