diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-07-06 23:24:01 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-07-06 23:24:01 +0200 |
commit | 2c1629e5974195899411da73e3b601dad5c24a3e (patch) | |
tree | 3cf8c10e2eb99bdfb2c95fb3a0ebdcf8b887d1fc /pyaggr3g470r/views/api/common.py | |
parent | Updated translations. (diff) | |
parent | Merged in jaesivsm/pyaggr3g470r (pull request #17) (diff) | |
download | newspipe-2c1629e5974195899411da73e3b601dad5c24a3e.tar.gz newspipe-2c1629e5974195899411da73e3b601dad5c24a3e.tar.bz2 newspipe-2c1629e5974195899411da73e3b601dad5c24a3e.zip |
Merge branch 'master' of bitbucket.org:cedricbonhomme/pyaggr3g470r
Diffstat (limited to 'pyaggr3g470r/views/api/common.py')
-rw-r--r-- | pyaggr3g470r/views/api/common.py | 6 |
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""" |