From 91d616f78490860fbbb40f25227e5c082f8be497 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Wed, 25 May 2011 19:48:47 +0200 Subject: bugfix diff --git a/nop/views.py b/nop/views.py index 610330f..a106493 100644 --- a/nop/views.py +++ b/nop/views.py @@ -68,6 +68,8 @@ def get(request, year=None, month=None, day=None, hour=None, minute=None): def nop_form(request): context = {} context.update(csrf(request)) + date = None + time = None if request.method == 'POST': form = NopForm(request.POST) if form.is_valid(): @@ -75,8 +77,8 @@ def nop_form(request): time = form.cleaned_data['time'] else: form = NopForm() - date = datetime.date(datetime.now()) - time = datetime.time(datetime.now()) + if not date: date = datetime.date(datetime.now()) + if not time: time = datetime.time(datetime.now()) result = _bydate(date.year, date.month, date.day, time.hour, time.minute) context['nowplaying'] = result context['form'] = form -- cgit v0.10.2