Wednesday, July 7, 2021

I worked on #4245 (Lino deleted the guests from my event) .

The problem happens only when can_edit_guests_manually() returns False. It seems that can_edit_guests_manually() should not base its decision on the state of the event. But when then do we have EntryState.fill_guests

In amici1, log in as robin, create an activity, check a weekday, hit update_events: Lino says “No automatic calendar entries because no entry type is configured.”

The std fixture of now sets the event type “Meeting” as SiteConfig.default_event_type.

lino_xl.lib.Course.update_cal_event_type() now returns SiteConfig.default_event_type if the activity has no line (or if the line has no event_type).

I replaced the can_edit_guests_manually() of by a new database field This is an invisible field, it is similar to lino_xl.lib.vat.VatDocument.items_edited

Manual tests

  • In Lino Amici, try to make Lino “accidentally” delete my manually entered guests.

  • In Lino Avanti: create a course with 2 enrolments. have it generate some lessons. check that the enrolments have become guests. manually edit the guest list in one event: add an extra guest. Add one new enrolment and remove one enrolment from the course, then run update_guests on the course. Check whether the guests of the first event have remained unchanged while the second event has received the new guest.

The manual tests pass. I run the test suite, which will need some changes because there is a new database field.