1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-15 23:00:57 +00:00

Merge pull request #139 from urg/UserProfile

add api call to add user profile
This commit is contained in:
xiez
2014-04-03 11:22:53 +08:00

View File

@@ -196,6 +196,19 @@ class Account(APIView):
serializer.object['is_staff'],
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:
resp = Response('success')
else: