@@ -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,11 +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 , code , 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
- return HttpResponse ( msg , status = code )
272
+ )
273
+ if resp :
274
+ return resp
276
275
277
276
# update name of Entry object. If name would be updated, the elasticsearch data of entries that
278
277
# refers this entry also be updated by creating REGISTERED_REFERRALS task.
@@ -561,7 +560,7 @@ def do_copy(request, entry_id, recv_data):
561
560
562
561
if custom_view .is_custom ("do_copy_entry" , entry .schema .name ):
563
562
(is_continue , status , msg ) = custom_view .call_custom (
564
- "do_copy_entry" , entry .schema .name , request , user , new_name )
563
+ "do_copy_entry" , entry .schema .name , request , entry , recv_data , user , new_name )
565
564
if not is_continue :
566
565
ret .append ({
567
566
'status' : 'success' if status else 'fail' ,
0 commit comments