Skip to content

Commit

Permalink
Added user email to me API
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Jun 24, 2015
1 parent c1b3017 commit 7d9021c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion udata/core/user/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from udata.features.transfer.models import Transfer

from .api_fields import (
me_fields,
user_fields,
user_page_fields,
user_suggestion_fields,
Expand All @@ -33,7 +34,7 @@
class MeAPI(API):
@api.secure
@api.doc('get_me')
@api.marshal_with(user_fields)
@api.marshal_with(me_fields)
def get(self):
'''Fetch the current user (me) identity'''
return current_user._get_current_object()
Expand Down
4 changes: 4 additions & 0 deletions udata/core/user/api_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
description='The user API URI', required=True),
})

me_fields = api.inherit('Me', user_fields, {
'email': fields.String(description='The user email', required=True)
})

user_page_fields = api.model('UserPage', fields.pager(user_fields))

user_suggestion_fields = api.model('UserSuggestion', {
Expand Down

0 comments on commit 7d9021c

Please sign in to comment.