diff options
author | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2018-02-16 15:50:22 -0500 |
---|---|---|
committer | Sawyer Bergeron <sbergeron@iol.unh.edu> | 2018-02-16 15:50:22 -0500 |
commit | 3979c0cc8fc863b1661353e96e17ffa166abfa96 (patch) | |
tree | d68e8231d67f086724ef3a3617252048f7c91c84 /dashboard/src/api/serializers.py | |
parent | 7734f7abbf16bc2b86c93d4b8cc510b1d86862c4 (diff) |
Expose Limited User Info Through API
Jira: PHAROS-362
Exposes info such as username and user email throught the API to facilitate
better backend integration
Change-Id: I8948f399000ffe41d5b75941f4a4195caaea91f4
Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'dashboard/src/api/serializers.py')
-rw-r--r-- | dashboard/src/api/serializers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dashboard/src/api/serializers.py b/dashboard/src/api/serializers.py index 1cc621a..10e1975 100644 --- a/dashboard/src/api/serializers.py +++ b/dashboard/src/api/serializers.py @@ -10,6 +10,7 @@ from rest_framework import serializers +from account.models import UserProfile from notifier.models import Notifier from booking.models import Booking from dashboard.models import Server, Resource, ResourceStatus @@ -44,3 +45,9 @@ class NotifierSerializer(serializers.ModelSerializer): class Meta: model = Notifier fields = ('id', 'title', 'content', 'user', 'sender', 'message_type', 'msg_sent') + +class UserSerializer(serializers.ModelSerializer): + username = serializers.CharField(source='user.username') + class Meta: + model = UserProfile + fields = ('user', 'username', 'ssh_public_key', 'pgp_public_key', 'email_addr') |