Skip to content

Commit

Permalink
Fix Python2 vs. Python3 text and bytes handling in the calendar portlet.
Browse files Browse the repository at this point in the history
  • Loading branch information
balavec committed Aug 6, 2019
1 parent 7fcbb4a commit cdc83d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions news/308.bugfix
@@ -0,0 +1 @@
Fix Python2 vs. Python3 text and bytes handling in the calendar portlet.
8 changes: 6 additions & 2 deletions plone/app/event/portlets/portlet_calendar.py
Expand Up @@ -279,12 +279,16 @@ def cal_data(self):
return caldata

def nav_pattern_options(self, year, month):
val = self.hash
if isinstance(val, bytes):
val = val.decode("utf-8")

return json.dumps({
'url': '%s/@@render-portlet?portlethash=%s&year=%s&month=%s' % (
getSite().absolute_url(),
self.hash,
val,
year, month),
'target': '#portletwrapper-%s > *' % self.hash
'target': '#portletwrapper-%s > *' % val
})

@property
Expand Down

0 comments on commit cdc83d5

Please sign in to comment.