Repository navigation
Presenter deletion, empty session sets and Tech Event permissions (#38, #47) - #50
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three backend fixes, each with tests that fail without it.
#38: deleting a referenced Presenter
When a Presenter is removed,
z3c.relationfieldnotifiesIObjectModifiedEventon every session that points to it, after breaking the relation. The session subscriber then calledreindexObjectonNone. It now skips broken relations. The session summary had the same problem once the presenter was gone (absolute_urlonNone), soformat_relationsskips them too.#47: empty
set()in the session summaryAn empty
session_audienceorsession_levelreached the summary asset(), 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 staysnull.Tech Event add permissions (no issue)
With
support_multiple_eventson,setup_tech_eventremoves "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 anIObjectAddedEventsubscriber, 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_v1008used to assert that 1007 → 1008 was the only upgrade on offer; it now keeps only its own step.Closes #38
Closes #47