From b21ea724ac619f218d6e18ee2439492609d5755b Mon Sep 17 00:00:00 2001 From: maxbr Date: Thu, 27 Jul 2017 12:51:47 +0200 Subject: [PATCH] Fix Booking API This fixes a server error for the booking REST api and some html errors. Change-Id: I86475967bbc8cd4c8f82f62e03789f1c9752d446 Signed-off-by: maxbr --- tools/pharos-dashboard/src/api/serializers.py | 7 +++---- tools/pharos-dashboard/src/templates/account/user_list.html | 1 + tools/pharos-dashboard/src/templates/booking/booking_list.html | 10 ++++------ tools/pharos-dashboard/src/templates/dashboard/ci_pods.html | 3 ++- tools/pharos-dashboard/src/templates/dashboard/dev_pods.html | 3 ++- .../src/templates/dashboard/jenkins_slaves.html | 3 ++- tools/pharos-dashboard/src/templates/dashboard/table.html | 9 +-------- tools/pharos-dashboard/src/templates/layout.html | 4 ++-- 8 files changed, 17 insertions(+), 23 deletions(-) diff --git a/tools/pharos-dashboard/src/api/serializers.py b/tools/pharos-dashboard/src/api/serializers.py index f8f02a2c..237ca029 100644 --- a/tools/pharos-dashboard/src/api/serializers.py +++ b/tools/pharos-dashboard/src/api/serializers.py @@ -13,10 +13,9 @@ from rest_framework import serializers from booking.models import Booking from dashboard.models import Server, Resource, ResourceStatus - class BookingSerializer(serializers.ModelSerializer): - installer_name = serializers.RelatedField(source='installer', read_only=True) - scenario_name = serializers.RelatedField(source='scenario', read_only=True) + installer_name = serializers.CharField(source='installer.name') + scenario_name = serializers.CharField(source='scenario.name') class Meta: model = Booking @@ -37,4 +36,4 @@ class ResourceSerializer(serializers.ModelSerializer): class ResourceStatusSerializer(serializers.ModelSerializer): class Meta: model = ResourceStatus - fields = ('id', 'resource', 'timestamp','type', 'title', 'content') \ No newline at end of file + fields = ('id', 'resource', 'timestamp','type', 'title', 'content') diff --git a/tools/pharos-dashboard/src/templates/account/user_list.html b/tools/pharos-dashboard/src/templates/account/user_list.html index f18e1618..68178ebe 100644 --- a/tools/pharos-dashboard/src/templates/account/user_list.html +++ b/tools/pharos-dashboard/src/templates/account/user_list.html @@ -47,6 +47,7 @@ -{% endblock extrajs %} \ No newline at end of file +{% endblock extrajs %} diff --git a/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html b/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html index 7ef62a43..a20be957 100644 --- a/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html +++ b/tools/pharos-dashboard/src/templates/dashboard/ci_pods.html @@ -50,6 +50,7 @@ -{% endblock tablejs %} \ No newline at end of file +{% endblock tablejs %} diff --git a/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html b/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html index 2b4b0177..a6f3b2ee 100644 --- a/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html +++ b/tools/pharos-dashboard/src/templates/dashboard/dev_pods.html @@ -59,6 +59,7 @@ -{% endblock tablejs %} \ No newline at end of file +{% endblock tablejs %} diff --git a/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html b/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html index aa74507c..fa361b13 100644 --- a/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html +++ b/tools/pharos-dashboard/src/templates/dashboard/jenkins_slaves.html @@ -35,6 +35,7 @@ -{% endblock tablejs %} \ No newline at end of file +{% endblock tablejs %} diff --git a/tools/pharos-dashboard/src/templates/dashboard/table.html b/tools/pharos-dashboard/src/templates/dashboard/table.html index addd5c12..d59f0e34 100644 --- a/tools/pharos-dashboard/src/templates/dashboard/table.html +++ b/tools/pharos-dashboard/src/templates/dashboard/table.html @@ -13,8 +13,6 @@ {% block content %}
-
-
@@ -25,9 +23,7 @@
-
-
@@ -36,9 +32,6 @@ {% block extrajs %} - - @@ -47,4 +40,4 @@ {% block tablejs %} {% endblock tablejs %} -{% endblock extrajs %} \ No newline at end of file +{% endblock extrajs %} diff --git a/tools/pharos-dashboard/src/templates/layout.html b/tools/pharos-dashboard/src/templates/layout.html index 64fed4ae..9578e155 100644 --- a/tools/pharos-dashboard/src/templates/layout.html +++ b/tools/pharos-dashboard/src/templates/layout.html @@ -20,7 +20,7 @@ - @@ -65,7 +65,7 @@ - + {% block extrajs %} {% endblock extrajs %} -- 2.16.6