Skip to content

Presenter deletion, empty session sets and Tech Event permissions (#38, #47) - #50

Merged
ericof merged 1 commit into
mainfrom
issues-38-47
Oct 29, 2026
Merged

ericof merged 1 commit into
mainfrom
issues-38-47

Conversation

@ericof

@ericof ericof commented Oct 28, 2026

Copy link
Copy Markdown
Member

Three backend fixes, each with tests that fail without it.

#38: deleting a referenced Presenter

When a Presenter is removed, z3c.relationfield notifies IObjectModifiedEvent on every session that points to it, after breaking the relation. The session subscriber then called reindexObject on None. It now skips broken relations. The session summary had the same problem once the presenter was gone (absolute_url on None), so format_relations skips them too.

#47: empty set() in the session summary

An empty session_audience or session_level reached the summary as set(), so any response that included it (such as adding an Image inside the Talk) answered 500. Empty collections now serialize as []; a field that was never set stays null.

Tech Event add permissions (no issue)

With support_multiple_events on, setup_tech_event removes "Add Presenter", "Add Venue" and "Add SponsorsDB" from the Plone Site, but nothing granted them on a Tech Event. The code stopped at a comment. Nobody, Manager included, could add a Presenter or Venue inside a Tech Event. A new Tech Event now grants them through an IObjectAddedEvent subscriber, enabling the setting grants them on existing events, and upgrade step 1008 → 1009 reapplies the setup on existing sites. The one-SponsorsDB-per-event limit is kept.

test_v1008 used to assert that 1007 → 1008 was the only upgrade on offer; it now keeps only its own step.

Closes #38
Closes #47

…issions (#38, #47)

Deleting a Presenter that a session references made z3c.relationfield
notify the session after breaking the relation, and the session
subscriber called reindexObject on None. The subscriber and the session
summary now skip broken relations.

The session summary returned an empty set() for empty session_audience
or session_level, which json.dumps cannot encode, so adding content
inside such a session answered 500. Empty collections now serialize as
an empty list; fields never set stay null.

With multiple events on, the Plone Site loses the permissions to add
Presenters, Venues and a SponsorsDB, and nothing granted them on a Tech
Event, so nobody could add that content inside one. A new Tech Event now
grants them, enabling multiple events grants them on existing events,
and upgrade step 1009 reapplies the setup on existing sites.

Closes #38
Closes #47
@ericof
ericof merged commit 1c8edad into main Oct 29, 2026
20 checks passed
@ericof
ericof deleted the issues-38-47 branch October 29, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant