Commit d0b585cb authored by louis kleverman's avatar louis kleverman

fixed issue

parent fd349a88
......@@ -298,24 +298,22 @@ class ProcessorHandler(JsonApiHandler):
if 'visibility' in self.body:
# Only admins can LOCK or UNLOCK
if self.current_user.admin:
licenced = self.body['licenced'] if 'licenced' in self.body else processor.licenced
# log.debug("POCESSOR LICENCE : %r " % licenced )
# log.debug("POCESSOR VISI BEFORE : %r " % processor.visibility )
if 'licenced' in self.body:
licenced = self.body['licenced']
processor.licenced = self.body['licenced']
update_processor_visibility(processor.id, processor.visibility, self.body['visibility'],licenced, processor.licenced )
processor.visibility = self.body['visibility']
processor.licenced = self.body['licenced']
else:
# NOT ADMIN
if 'licenced' in self.body: # YOU ARE NOT ALLOWED TO UPDATE THE LICENCE IF YOU'RE NOT ADMIN
raise HTTPError(HTTPStatus.FORBIDDEN)
if processor.visibility == ProcessorVisibility.PRIVATE_LOCKED:
raise HTTPError(HTTPStatus.FORBIDDEN)
elif self.body['visibility'] == ProcessorVisibility.PRIVATE_LOCKED:
raise HTTPError(HTTPStatus.FORBIDDEN)
else:
licenced = self.body['licenced'] if 'licenced' in self.body else processor.licenced
# log.debug("POCESSOR VISI BEFORE : %r " % processor.visibility )
# log.debug("POCESSOR LICENCE : %r " % licenced )
update_processor_visibility(processor.id, processor.visibility, self.body['visibility'], licenced, processor.licenced )
update_processor_visibility(processor.id, processor.visibility, self.body['visibility'], processor.licenced, processor.licenced )
processor.visibility = self.body['visibility']
processor.licenced = self.body['licenced']
elif 'licenced' in self.body:
# Only admins can LICENCE or UNLICENCE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment