Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed Jan 27, 2025
2 parents 96e73a0 + 14a575f commit 9f75411
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 12 deletions.
26 changes: 20 additions & 6 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,35 @@
Changelog
=========

2.0.4 (unreleased)
2.0.6 (unreleased)
------------------

- DELIB-11: Fixed an issue with next/prev navigation on `ItemView` when items are not in correct order
in the meeting folder.
[aduchene]
- DELIBE-3: Add meeting date in the title of `PreSyncForm` and `PreImportForm`.
[aduchene]
- DELIBE-186: Add a new Prometheus export view `prometheus-export` to monitor cron.
[aduchene]
- Complete tests about `MeetingAgendaAPIView`.
[aduchene]
- Rename `institution_locations` view name to `institution-locations`.
[aduchene]

2.0.5 (2024-12-19)
------------------

- DELIBE-12: Avoid a "@@confirm-action" on `Institution` creation.
[aduchene]
- DELIBE-29: Add ZoomControl back on institutions map
[aduchene]
- DELIBE-180: Fix some issues when an `Institution.representatives_mappings` could be None.
[aduchene]

2.0.4 (2024-10-23)
------------------

- DELIB-11: Fixed an issue with next/prev navigation on `ItemView` when items are not in correct order
in the meeting folder.
[aduchene]
- DELIBE-3: Add meeting date in the title of `PreSyncForm` and `PreImportForm`.
[aduchene]

2.0.3 (2024-10-10)
------------------

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
)
setup(
name="plonemeeting.portal.core",
version="2.0.4.dev0",
version="2.0.6.dev0",
description="Plonemeeting decisions publication portal",
long_description=long_description,
long_description_content_type="text/x-rst",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const InstitutionsMap = (props) => {
zoomControl={false}
style={{height: height}}
>
{/*<ZoomControl position={"bottomright"}/>*/}
<ZoomControl position={"bottomright"}/>
<TileLayer
attribution='Carte &copy; <a href="http://osm.org/copyright">OpenStreetMap</a> | Données &copy; <a href="https://www.ngi.be/website/fr/">NGI-IGN</a> '
url="https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"
Expand Down
2 changes: 1 addition & 1 deletion src/plonemeeting/portal/core/browser/static/js/core.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/plonemeeting/portal/core/content/institution.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def representatives_mappings_invariant(data):
changes = {}
for rpz in new_representatives:
changes[rpz['representative_key']] = rpz['representative_value']
if data.__context__:
if data.__context__ and data.__context__.representatives_mappings:
for rpz in data.__context__.representatives_mappings:
rpz_uid = rpz['representative_key']
if rpz_uid not in changes and rpz_uid not in missing_uids:
Expand Down
3 changes: 2 additions & 1 deletion src/plonemeeting/portal/core/events/institution.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from plone import api
from plone.api.exc import CannotGetPortalError
from plone.api.portal import get_registry_record
from plone.protect.utils import addTokenToUrl
from plonemeeting.portal.core import _
from plonemeeting.portal.core import logger
from plonemeeting.portal.core.config import DEC_FOLDER_ID
Expand Down Expand Up @@ -69,7 +70,7 @@ def handle_institution_creation(obj, event):

request = getRequest()
if request: # Request can be `None` during test setup
request.response.redirect(obj.absolute_url())
request.response.redirect(addTokenToUrl(obj.absolute_url()))


def handle_institution_modified(institution, event):
Expand Down
2 changes: 1 addition & 1 deletion src/plonemeeting/portal/core/sync_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def _get_mapped_representatives_in_charge(item_data, institution):
) or item_data.get("all_groupsInCharge")

res = []
if groups_in_charge:
if groups_in_charge and institution.representatives_mappings:
gic_tokens = [gic["token"] for gic in groups_in_charge]
mapped_uids = [mapping["representative_key"] for mapping in institution.representatives_mappings]
res = list(filter(lambda uid: uid in mapped_uids, gic_tokens))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def test_fetch_category_only_once_on_edit(self):
'population': 'Population / État-civil',
'locations': 'Locations',
'divers': 'Divers',
'engagement': 'Engagement',
'finances': 'Finances'},
self.belleville.delib_categories)

Expand Down Expand Up @@ -125,3 +126,6 @@ def __init__(self, institution, categories_mappings, representatives_mappings):
'representative_long_value': 'fake name long',
'representative_value': 'fake name'}, )
representatives_mappings_invariant(data)

data.__context__.representatives_mappings = None # Could be None in Plone 6
representatives_mappings_invariant(data)
3 changes: 3 additions & 0 deletions src/plonemeeting/portal/core/tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ def test_sync_meeting_items(self):
self.assertEqual(meeting.values()[20].category, 'batiment')
self.assertEqual(meeting.values()[-1].category, 'batiment')

self.institution.representatives_mappings = None
sync_items_data(meeting, self.json_meeting_items, self.institution, force=True)

def test_sync_with_updates_meeting_items(self):
meeting = sync_meeting_data(self.institution, self.json_meeting.get("items")[0])
# only a few picked items
Expand Down

0 comments on commit 9f75411

Please sign in to comment.