Skip to content
Snippets Groups Projects
Unverified Commit 43bb30f9 authored by Marco Marinello's avatar Marco Marinello
Browse files

Move importation to the top, fix date format. refs #660

parent ce4f384d
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ from django.views.generic import ListView, CreateView
from django.views.generic import UpdateView, DetailView
from octomon.mixins import UserMixin
import stats.models as stmodels
import datetime as dt
class AreaList(UserMixin, ListView):
model = smodels.Area
......@@ -299,8 +300,6 @@ def computers_dismissed(request, id):
@login_required
def get_schools_activities_json(request, id=None):
import datetime as dt
# Collect GET variables
sSearch = request.GET.get('sSearch', None)
sEcho = request.GET.get('sEcho', None)
......@@ -361,8 +360,8 @@ def get_schools_activities_json(request, id=None):
for activity in activities[start:start+length]:
row = []
row.append("%s" % activity.timestamp.strftime('%Y-%m-%d %H:%M:%S'))
row.append("%s" % activity.end_timestamp.strftime('%Y-%m-%d %H:%M:%S'))
row.append("%s" % activity.timestamp.strftime('%d/%m/%Y %H:%M:%S'))
row.append("%s" % activity.end_timestamp.strftime('%d/%m/%Y %H:%M:%S'))
row.append("%s" % activity.user)
row.append("%s" % activity.description)
if request.user.has_perm('schools.change_activity'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment