1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-25 14:50:29 +00:00

add api call to add user profile

This commit is contained in:
Patrick McAndrew
2014-01-22 17:12:27 +00:00
parent 112cb87db4
commit 08e26cbf23

View File

@@ -196,6 +196,19 @@ class Account(APIView):
serializer.object['is_staff'], serializer.object['is_staff'],
serializer.object['is_active']) serializer.object['is_active'])
name = request.DATA.get("name", None)
note = request.DATA.get("note", None)
if name or note:
try:
profile = Profile.objects.get(user=user.username)
except Profile.DoesNotExist:
profile = Profile()
profile.user = user.username
profile.nickname = name
profile.intro = note
profile.save()
if update: if update:
resp = Response('success') resp = Response('success')
else: else: