summaryrefslogtreecommitdiffstats
path: root/tools/pharos-dashboard/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'tools/pharos-dashboard/dashboard')
-rw-r--r--tools/pharos-dashboard/dashboard/__init__.py10
-rw-r--r--tools/pharos-dashboard/dashboard/admin.py10
-rw-r--r--tools/pharos-dashboard/dashboard/apps.py10
-rw-r--r--tools/pharos-dashboard/dashboard/migrations/__init__.py10
-rw-r--r--tools/pharos-dashboard/dashboard/models.py10
-rw-r--r--tools/pharos-dashboard/dashboard/tasks.py23
-rw-r--r--tools/pharos-dashboard/dashboard/templatetags/__init__.py10
-rw-r--r--tools/pharos-dashboard/dashboard/templatetags/jenkins_filters.py10
-rw-r--r--tools/pharos-dashboard/dashboard/templatetags/jira_filters.py10
-rw-r--r--tools/pharos-dashboard/dashboard/urls.py11
-rw-r--r--tools/pharos-dashboard/dashboard/views.py10
11 files changed, 123 insertions, 1 deletions
diff --git a/tools/pharos-dashboard/dashboard/__init__.py b/tools/pharos-dashboard/dashboard/__init__.py
index e69de29b..b5914ce7 100644
--- a/tools/pharos-dashboard/dashboard/__init__.py
+++ b/tools/pharos-dashboard/dashboard/__init__.py
@@ -0,0 +1,10 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
diff --git a/tools/pharos-dashboard/dashboard/admin.py b/tools/pharos-dashboard/dashboard/admin.py
index 71a1e7d2..a1463a7a 100644
--- a/tools/pharos-dashboard/dashboard/admin.py
+++ b/tools/pharos-dashboard/dashboard/admin.py
@@ -1,3 +1,13 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
from django.contrib import admin
from dashboard.models import *
diff --git a/tools/pharos-dashboard/dashboard/apps.py b/tools/pharos-dashboard/dashboard/apps.py
index 50878e76..e0c4f442 100644
--- a/tools/pharos-dashboard/dashboard/apps.py
+++ b/tools/pharos-dashboard/dashboard/apps.py
@@ -1,3 +1,13 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
from django.apps import AppConfig
diff --git a/tools/pharos-dashboard/dashboard/migrations/__init__.py b/tools/pharos-dashboard/dashboard/migrations/__init__.py
index e69de29b..b5914ce7 100644
--- a/tools/pharos-dashboard/dashboard/migrations/__init__.py
+++ b/tools/pharos-dashboard/dashboard/migrations/__init__.py
@@ -0,0 +1,10 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
diff --git a/tools/pharos-dashboard/dashboard/models.py b/tools/pharos-dashboard/dashboard/models.py
index 734da386..050834ea 100644
--- a/tools/pharos-dashboard/dashboard/models.py
+++ b/tools/pharos-dashboard/dashboard/models.py
@@ -1,3 +1,13 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
from datetime import timedelta
from django.utils import timezone
diff --git a/tools/pharos-dashboard/dashboard/tasks.py b/tools/pharos-dashboard/dashboard/tasks.py
new file mode 100644
index 00000000..4c09bf90
--- /dev/null
+++ b/tools/pharos-dashboard/dashboard/tasks.py
@@ -0,0 +1,23 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
+from celery import shared_task
+from datetime import timedelta
+from django.utils import timezone
+
+from jenkins.models import JenkinsStatistic
+from notification.models import BookingNotification
+
+
+@shared_task
+def database_cleanup():
+ now = timezone.now()
+ JenkinsStatistic.objects.filter(timestamp__lt=now - timedelta(weeks=4)).delete()
+ BookingNotification.objects.filter(submit_time__lt=now - timedelta(weeks=4)).delete() \ No newline at end of file
diff --git a/tools/pharos-dashboard/dashboard/templatetags/__init__.py b/tools/pharos-dashboard/dashboard/templatetags/__init__.py
index e69de29b..b5914ce7 100644
--- a/tools/pharos-dashboard/dashboard/templatetags/__init__.py
+++ b/tools/pharos-dashboard/dashboard/templatetags/__init__.py
@@ -0,0 +1,10 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
diff --git a/tools/pharos-dashboard/dashboard/templatetags/jenkins_filters.py b/tools/pharos-dashboard/dashboard/templatetags/jenkins_filters.py
index f5038ea5..e7e14257 100644
--- a/tools/pharos-dashboard/dashboard/templatetags/jenkins_filters.py
+++ b/tools/pharos-dashboard/dashboard/templatetags/jenkins_filters.py
@@ -1,3 +1,13 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
from django.template.defaultfilters import register
diff --git a/tools/pharos-dashboard/dashboard/templatetags/jira_filters.py b/tools/pharos-dashboard/dashboard/templatetags/jira_filters.py
index 1be0600b..70208436 100644
--- a/tools/pharos-dashboard/dashboard/templatetags/jira_filters.py
+++ b/tools/pharos-dashboard/dashboard/templatetags/jira_filters.py
@@ -1,3 +1,13 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
from django.template.defaultfilters import register
from django.conf import settings
diff --git a/tools/pharos-dashboard/dashboard/urls.py b/tools/pharos-dashboard/dashboard/urls.py
index baa2d633..f04f5ca9 100644
--- a/tools/pharos-dashboard/dashboard/urls.py
+++ b/tools/pharos-dashboard/dashboard/urls.py
@@ -1,3 +1,13 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
"""pharos_dashboard URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
@@ -14,7 +24,6 @@ Including another URLconf
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
-
from dashboard.views import *
urlpatterns = [
diff --git a/tools/pharos-dashboard/dashboard/views.py b/tools/pharos-dashboard/dashboard/views.py
index 0eddc130..022a4af0 100644
--- a/tools/pharos-dashboard/dashboard/views.py
+++ b/tools/pharos-dashboard/dashboard/views.py
@@ -1,3 +1,13 @@
+##############################################################################
+# Copyright (c) 2016 Max Breitenfeldt and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+
from datetime import timedelta
from django.http import JsonResponse