summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Raggam <raggam-nl@adm.at>2011-05-25 17:48:47 (GMT)
committerJohannes Raggam <raggam-nl@adm.at>2011-05-25 17:48:47 (GMT)
commit91d616f78490860fbbb40f25227e5c082f8be497 (patch)
treece0723375ffc1f44f6f66113740dc98f287adbb0
parentca24a30ec6940052a259db5b38e85731ee7a3d27 (diff)
bugfix
-rw-r--r--nop/views.py6
1 files changed, 4 insertions, 2 deletions
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