Fixes 1367 by preventing pyang discard repeated constituent-base-element-id
[osm/NBI.git] / osm_nbi / base_topic.py
index 9572409..bbe6337 100644 (file)
@@ -147,7 +147,7 @@ class BaseTopic:
             if count >= quota:
                 name = proj["name"]
                 raise ValidationError("quota ({}={}) exceeded for project {} ({})".format(quota_name, quota, name, pid),
             if count >= quota:
                 name = proj["name"]
                 raise ValidationError("quota ({}={}) exceeded for project {} ({})".format(quota_name, quota, name, pid),
-                                      http_code=HTTPStatus.UNAUTHORIZED)
+                                      http_code=HTTPStatus.UNPROCESSABLE_ENTITY)
 
     def _validate_input_new(self, input, force=False):
         """
 
     def _validate_input_new(self, input, force=False):
         """
@@ -308,6 +308,7 @@ class BaseTopic:
 
     def _send_msg(self, action, content, not_send_msg=None):
         if self.topic_msg and not_send_msg is not False:
 
     def _send_msg(self, action, content, not_send_msg=None):
         if self.topic_msg and not_send_msg is not False:
+            content = content.copy()
             content.pop("_admin", None)
             if isinstance(not_send_msg, list):
                 not_send_msg.append((self.topic_msg, action, content))
             content.pop("_admin", None)
             if isinstance(not_send_msg, list):
                 not_send_msg.append((self.topic_msg, action, content))