Skip to content

Commit

Permalink
Handle empty proposingGroups in setProposingGroupsWithGroupsInCharge
Browse files Browse the repository at this point in the history
  • Loading branch information
duchenean committed Dec 11, 2024
1 parent 545b6f1 commit 03198c1
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/Products/PloneMeeting/MeetingItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -3299,12 +3299,15 @@ def setProposingGroupWithGroupInCharge(self, value, **kwargs):
field = self.getField('proposingGroupWithGroupInCharge')
current_value = field.get(self, **kwargs)
if not value == current_value:
# value may be empty if used on an itemTemplate
proposingGroup = groupInCharge = ''
proposingGroup = self.getProposingGroup()
groupsInCharge = self.getGroupsInCharge()
if self.isDefinedInTool(item_type='itemtemplate'):
# value may be empty if used on an itemTemplate
proposingGroup = groupsInCharge = ''
if value:
proposingGroup, groupInCharge = value.split('__groupincharge__')
proposingGroup, groupsInCharge = value.split('__groupincharge__')
self.setProposingGroup(proposingGroup)
self.setGroupsInCharge([groupInCharge])
self.setGroupsInCharge([groupsInCharge] if not type(groupsInCharge) is list else groupsInCharge)
field.set(self, value, **kwargs)

def _adaptLinesValueToBeCompared(self, value):
Expand Down Expand Up @@ -7823,13 +7826,7 @@ def cloneToOtherMeetingConfig(self, destMeetingConfigId, automatically=False):
newCat = getattr(destMeetingConfig.categories, destCat.split('.')[1])
newItem.setCategory(newCat.getId())
break
if 'proposingGroupWithGroupInCharge' in cfg.getUsedItemAttributes() and \
'proposingGroupWithGroupInCharge' not in destUsedItemAttributes and \
not newItem.getProposingGroup():
# Handle an edge case when 'proposingGroupWithGroupInCharge' is not used in destMeetingConfig
# to avoid an empty proposingGroup
newItem.setProposingGroup(self.getProposingGroupWithGroupInCharge().split("__groupincharge__")[0])

j
# find meeting to present the item in and set it as preferred
# this way if newItem needs to be presented in a frozen meeting, it works
# as it requires the preferredMeeting to be the frozen meeting
Expand Down

0 comments on commit 03198c1

Please sign in to comment.