forked from 0x2620/pandora
only return requested keys
This commit is contained in:
parent
d89dd35892
commit
77b19abd74
2 changed files with 2 additions and 2 deletions
|
@ -312,7 +312,6 @@ class Edit(models.Model):
|
||||||
'user',
|
'user',
|
||||||
]
|
]
|
||||||
response = {
|
response = {
|
||||||
'type': self.type
|
|
||||||
}
|
}
|
||||||
_map = {
|
_map = {
|
||||||
'posterFrames': 'poster_frames'
|
'posterFrames': 'poster_frames'
|
||||||
|
|
|
@ -201,6 +201,7 @@ def getEdit(request):
|
||||||
'''
|
'''
|
||||||
takes {
|
takes {
|
||||||
id:
|
id:
|
||||||
|
keys: []
|
||||||
}
|
}
|
||||||
returns {
|
returns {
|
||||||
id:
|
id:
|
||||||
|
@ -212,7 +213,7 @@ def getEdit(request):
|
||||||
response = json_response()
|
response = json_response()
|
||||||
edit = get_edit_or_404_json(data['id'])
|
edit = get_edit_or_404_json(data['id'])
|
||||||
if edit.accessible(request.user):
|
if edit.accessible(request.user):
|
||||||
response['data'] = edit.json(user=request.user)
|
response['data'] = edit.json(keys=data.get('keys'), user=request.user)
|
||||||
else:
|
else:
|
||||||
response = json_response(status=403, text='not allowed')
|
response = json_response(status=403, text='not allowed')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue