aboutsummaryrefslogtreecommitdiff
path: root/pyaggr3g470r/views/api/common.py
diff options
context:
space:
mode:
authorCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-07-06 23:22:59 +0200
committerCédric Bonhomme <kimble.mandel+bitbucket@gmail.com>2015-07-06 23:22:59 +0200
commit2676d9881593f03142bd790ae5603c07e99c1adf (patch)
tree8f12fe10f1c79b6e036c09f44902f83f76940e6f /pyaggr3g470r/views/api/common.py
parentMinor fixes from a quick review. Need to test deeper. (diff)
parentmaking it possible for super admin to update other's feed (diff)
downloadnewspipe-2676d9881593f03142bd790ae5603c07e99c1adf.tar.gz
newspipe-2676d9881593f03142bd790ae5603c07e99c1adf.tar.bz2
newspipe-2676d9881593f03142bd790ae5603c07e99c1adf.zip
Merged in jaesivsm/pyaggr3g470r (pull request #17)
sorry, another pull request in a very short delay
Diffstat (limited to 'pyaggr3g470r/views/api/common.py')
-rw-r--r--pyaggr3g470r/views/api/common.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pyaggr3g470r/views/api/common.py b/pyaggr3g470r/views/api/common.py
index b8c4dd9d..a7068807 100644
--- a/pyaggr3g470r/views/api/common.py
+++ b/pyaggr3g470r/views/api/common.py
@@ -143,7 +143,11 @@ class PyAggResourceExisting(PyAggAbstractResource):
args = self.reqparse_args(default=False)
new_values = {key: args[key] for key in
set(args).intersection(self.attrs)}
- self.controller.update({'id': obj_id}, new_values)
+ if 'user_id' in new_values and g.user.is_admin():
+ controller = self.wider_controller
+ else:
+ controller = self.controller
+ return controller.update({'id': obj_id}, new_values), 200
def delete(self, obj_id=None):
"""delete a object"""
bgstack15