Bugfix for Countdown
- error when for the next event no displaytime was available - better display when no time or location for the next event is known
This commit is contained in:
@@ -32,7 +32,8 @@ def home_view(request):
|
||||
if ( len(events) > 0 ):
|
||||
i = 0
|
||||
nextEvent = events[0]
|
||||
while datetime.combine( nextEvent.date, nextEvent.time ) < datetime.now():
|
||||
|
||||
while nextEvent.displaydatetime < datetime.now():
|
||||
if len(events ) <= i:
|
||||
return
|
||||
else:
|
||||
@@ -43,8 +44,7 @@ def home_view(request):
|
||||
part = EventParticipation.objects.filter( user = request.user ).filter( event = nextEvent )
|
||||
countdown['participation'] = part[0].status
|
||||
|
||||
eventTime = datetime( nextEvent.date.year, nextEvent.date.month, nextEvent.date.day,
|
||||
nextEvent.displaytime.hour, nextEvent.displaytime.minute )
|
||||
eventTime = nextEvent.displaydatetime
|
||||
|
||||
countdown['event'] = nextEvent
|
||||
countdown['epoch'] = int( (eventTime - datetime.now() ).total_seconds() * 1000 )
|
||||
|
||||
Reference in New Issue
Block a user