@@ -213,13 +213,15 @@ def post(self, request, *args, **kwargs):
213213 id = (
214214 entity_form .cleaned_data ["entity_id" ]
215215 if entity_selector == "id"
216+ and entity_form .cleaned_data ["entity_id" ]
216217 else None
217218 ),
218219 idPattern = (
219220 utils .safe_compile (
220221 entity_form .cleaned_data ["entity_id" ]
221222 )
222223 if entity_selector == "id_pattern"
224+ and entity_form .cleaned_data ["entity_id" ]
223225 else None
224226 ),
225227 type = (
@@ -233,6 +235,7 @@ def post(self, request, *args, **kwargs):
233235 entity_form .cleaned_data ["entity_type" ]
234236 )
235237 if type_selector == "type_pattern"
238+ and entity_form .cleaned_data ["entity_type" ]
236239 else None
237240 ),
238241 )
@@ -251,6 +254,21 @@ def post(self, request, *args, **kwargs):
251254 )
252255 messages .error (request , e )
253256 return self .form_invalid (form )
257+ except ValueError as e :
258+ logger .error (
259+ str (
260+ self .request .user .first_name
261+ if self .request .user .first_name
262+ else self .request .user .username
263+ )
264+ + " tried updating the subscription with name "
265+ + self .object .uuid
266+ + " but failed "
267+ f" in project { self .project .name } "
268+ )
269+ messages .error (request , e )
270+ return self .form_invalid (form )
271+
254272 with ContextBrokerClient (
255273 url = settings .CB_URL ,
256274 fiware_header = FiwareHeader (
0 commit comments