[CMF-checkins] CVS: CMF/CMFCalendar/skins/zpt_calendar - getMonthAndYear.py:1.1.6.1
Tres Seaver
tseaver@zope.com
Fri, 2 Aug 2002 13:21:38 -0400
Update of /cvs-repository/CMF/CMFCalendar/skins/zpt_calendar
In directory cvs.zope.org:/tmp/cvs-serv5746/CMFCalendar/skins/zpt_calendar
Modified Files:
Tag: CMF-1_3-branch
getMonthAndYear.py
Log Message:
- Don't touch sessions *at all* if 'use_session' is disabled; disable
it by default.
=== CMF/CMFCalendar/skins/zpt_calendar/getMonthAndYear.py 1.1 => 1.1.6.1 ===
# First priority goes to the data in the request
year = context.REQUEST.get('year', None)
month = context.REQUEST.get('month', None)
+session = None
# Next get the data from the SESSION
-session = context.REQUEST.get('SESSION', None)
-if session and use_session=="True":
- if not year: year = session.get('calendar_year', None)
- if not month: month = session.get('calendar_month', None)
+if use_session == "True":
+ session = context.REQUEST.get('SESSION', None)
+ if session:
+ if not year: year = session.get('calendar_year', None)
+ if not month: month = session.get('calendar_month', None)
# Last resort to Today
if not year: year = current.year()
if not month: month = current.month()
# Then store the results in the session for next time
-if session and use_session=="True":
+if session:
session.set('calendar_year', year)
session.set('calendar_month', month)