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 | 8e1e43c7b7cdec5afe77829e9f0b1ffb4e80cdb2 (patch) | |
tree | 5ef34e39185280302d87d6dd27b887c233bab32b /pharos-dashboard/src/api | |
parent | 43803375b8f30150026362fec4135f4eb8b75bd6 (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 'pharos-dashboard/src/api')
-rw-r--r-- | pharos-dashboard/src/api/serializers.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pharos-dashboard/src/api/serializers.py b/pharos-dashboard/src/api/serializers.py index f8f02a2..237ca02 100644 --- a/pharos-dashboard/src/api/serializers.py +++ b/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') |