comparison gpp/gcalendar/views.py @ 345:f7fbb404241f

Fix #164; have the calendar display times in the user's time zone. If the user isn't logged in, just use US/Pacific. Default the calendar mode to agenda mode.
author Brian Neal <bgneal@gmail.com>
date Mon, 28 Feb 2011 01:58:38 +0000
parents dbd703f7d63a
children
comparison
equal deleted inserted replaced
344:7eed448b399c 345:f7fbb404241f
16 from gcalendar.forms import EventEntryForm 16 from gcalendar.forms import EventEntryForm
17 from gcalendar.models import Event 17 from gcalendar.models import Event
18 18
19 19
20 def index(request): 20 def index(request):
21 user = request.user
22 if user.is_authenticated():
23 profile = user.get_profile()
24 tz = profile.time_zone
25 else:
26 tz = 'US/Pacific'
27
21 return render_to_response('gcalendar/index.html', { 28 return render_to_response('gcalendar/index.html', {
29 'tz': tz,
22 }, 30 },
23 context_instance = RequestContext(request)) 31 context_instance = RequestContext(request))
24 32
25 33
26 @login_required 34 @login_required