diff options
author | maxbr <maxbr@mi.fu-berlin.de> | 2017-07-27 12:51:47 +0200 |
---|---|---|
committer | maxbr <maxbr@mi.fu-berlin.de> | 2017-07-27 12:56:48 +0200 |
commit | b21ea724ac619f218d6e18ee2439492609d5755b (patch) | |
tree | e532e9112fc6a3785a4c623c6710617b5a58a910 /tools/pharos-dashboard/src/api | |
parent | 7cbe4e7447280d39fdb5a56b3d9a0fea437b5b15 (diff) |
Fix Booking API
This fixes a server error for the booking REST api and some html errors.
Change-Id: I86475967bbc8cd4c8f82f62e03789f1c9752d446
Signed-off-by: maxbr <maxbr@mi.fu-berlin.de>
Diffstat (limited to 'tools/pharos-dashboard/src/api')
-rw-r--r-- | tools/pharos-dashboard/src/api/serializers.py | 7 |
1 files changed, 3 insertions, 4 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') |