X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FNBI.git;a=blobdiff_plain;f=osm_nbi%2Fbase_topic.py;h=1f7f5d49fb805fa7b6549297bf0c904ce9c06561;hp=e849bb843ee8c4dcb5a9f8cb1a0562db72abccc3;hb=d7749588e6cc73661d052fc5bb41605e1b588128;hpb=974276d1b4e7fe9cf177702eb6d657aa42618a41 diff --git a/osm_nbi/base_topic.py b/osm_nbi/base_topic.py index e849bb8..1f7f5d4 100644 --- a/osm_nbi/base_topic.py +++ b/osm_nbi/base_topic.py @@ -114,7 +114,7 @@ class BaseTopic: DbException if project not found ValidationError if quota exceeded and not overridden """ - if session["force"] or session["admin"]: + if session["force"]: return projects = session["project_id"] for project in projects: @@ -124,7 +124,8 @@ class BaseTopic: count = self.db.count(self.topic, {"_admin.projects_read": pid}) if count >= quota: name = proj["name"] - raise ValidationError("{} quota ({}) exceeded for project {} ({})".format(self.topic, quota, name, pid)) + raise ValidationError("quota ({}={}) exceeded for project {} ({})".format(self.topic, quota, name, pid), + http_code=HTTPStatus.UNAUTHORIZED) def _validate_input_new(self, input, force=False): """