X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fbase_topic.py;h=216c9df5a373fed2bd979d960797189a86b31eab;hp=daa7a6b2104efcadc7816ed76f01e920698611b1;hb=deba68eb04ae450a54ef73923f8034d07707a791;hpb=02e700c9eceb147f4c72c8fe18975bfaac6ec759 diff --git a/osm_nbi/base_topic.py b/osm_nbi/base_topic.py index daa7a6b..216c9df 100644 --- a/osm_nbi/base_topic.py +++ b/osm_nbi/base_topic.py @@ -140,7 +140,7 @@ class BaseTopic: validate_input(input, self.schema_new) return input - def _validate_input_edit(self, input, force=False): + def _validate_input_edit(self, input, content, force=False): """ Validates input user content for an edition. It uses jsonschema. Some overrides will use pyangbind :param input: user input content for the new topic @@ -538,11 +538,13 @@ class BaseTopic: if indata and session.get("set_project"): raise EngineException("Cannot edit content and set to project (query string SET_PROJECT) at same time", HTTPStatus.UNPROCESSABLE_ENTITY) - indata = self._validate_input_edit(indata, force=session["force"]) - + # TODO self._check_edition(session, indata, _id, force) if not content: content = self.show(session, _id) + + indata = self._validate_input_edit(indata, content, force=session["force"]) + deep_update_rfc7396(content, indata) # To allow project addressing by name AS WELL AS _id. Get the _id, just in case the provided one is a name