@@ -178,13 +178,11 @@ def do_create(request, entity_id, recv_data):
178
178
return err
179
179
180
180
if custom_view .is_custom ("do_create_entry" , entity .name ):
181
- (is_continue , resp , msg ) = custom_view .call_custom (
181
+ # resp is HttpReponse instance or its subclass (e.g. JsonResponse)
182
+ resp = custom_view .call_custom (
182
183
"do_create_entry" , entity .name , request , recv_data , user , entity )
183
- if not is_continue :
184
- if isinstance (resp , int ):
185
- return HttpResponse (msg , status = resp )
186
- elif isinstance (resp , JsonResponse ):
187
- return resp
184
+ if resp :
185
+ return resp
188
186
189
187
# Create a new Entry object
190
188
entry = Entry .objects .create (name = recv_data ['entry_name' ],
@@ -268,14 +266,12 @@ def do_edit(request, entry_id, recv_data):
268
266
return HttpResponse ('Target entry is now under processing' , status = 400 )
269
267
270
268
if custom_view .is_custom ("do_edit_entry" , entry .schema .name ):
271
- (is_continue , resp , msg ) = custom_view .call_custom (* [
269
+ # resp is HttpReponse instance or its subclass (e.g. JsonResponse)
270
+ resp = custom_view .call_custom (
272
271
"do_edit_entry" , entry .schema .name , request , recv_data , user , entry
273
- ])
274
- if not is_continue :
275
- if isinstance (resp , int ):
276
- return HttpResponse (msg , status = resp )
277
- elif isinstance (resp , JsonResponse ):
278
- return resp
272
+ )
273
+ if resp :
274
+ return resp
279
275
280
276
# update name of Entry object. If name would be updated, the elasticsearch data of entries that
281
277
# refers this entry also be updated by creating REGISTERED_REFERRALS task.
0 commit comments