Django 4.2 how to display deleted object failure in modeladmin page?

Code used to override the delete_queryset in the modeladmin:

    def get_actions(self, request):
        actions = super().get_actions(request)        
        del actions['delete_selected']
        return actions

   def really_delete_selected(self, request, queryset):
        '''
        # 1. Update the group-mailbox relation: `goto` values if mailbox(es) are deleted
        # 2. Sending a mail to the current user with CSV of mailboxes deleted
        # 3. Used domain space will reduce by the maxquota of mailbox
        '''
        response = None
        print('delete from mailbox queryset called')
        try:
            mbox_list = []
            failed_deletions = []
            print(queryset)
            for obj in queryset:
                mdomain = None
                # COMPLETE MAILBOX DELETION OF FOLDERS, DOVECOT ENTRY, ADMIN PANEL PERMANENTLY 
                api_delete_status = call_purge_mailbox_api(request,obj)
                response = api_delete_status
                print('response---------',response, response['status_code'])                
                if response['status_code'] == 200:
                    # Set the quota value after deletion of mailbox(es)
                    mdomain = Domain.objects.get(id=obj.domain.pk)
                    mdomain.quota -= obj.maxquota
                    mdomain.save()
                    mbox_list.append(obj.email) 
                    # Remove the user from the group mailing lists
                    # master_grp_list = GroupMailIds.objects.exclude(goto=None)
                    removed_from_groups :bool = remove_from_group_lists(obj.email,mbox_list)
                    print('mailbox deletion completed.....')
                    # TODO: List for sending a mail to the currently logged in user with CSV of
                    # mailboxes deleted
                else:
                    print('Failed to delete mailbox:', obj.email)
                    failed_deletions.append(obj.email)
 
            print(failed_deletions, len(failed_deletions))

            if mbox_list:  # Check if any mailboxes were successfully deleted
                self.message_user(request, f"Successfully deleted {len(mbox_list)} mailbox(es).",level='success')
            for email in failed_deletions:  # Display error message for each failed deletion
                self.message_user(request, f"Failed to delete {email}. Mailbox absent. Contact helpdesk.",level='error')
            if not mbox_list and not failed_deletions:  # Check if no deletions were attempted
                self.message_user(request, "No mailboxes were selected for deletion.",level='error')
                #return messages.error(request, "No mailboxes were selected for deletion.")
        except Exception as e:
            print(e)
            self.message_user(request, f"Failed to delete items: {str(e)}", level='error')
    really_delete_selected.short_description = "Delete selected entries"




def delete_model(self, request, obj):
        try:
            # Perform the deletion
            api_delete_status = call_purge_mailbox_api(request,obj)
            print('8888888')
            response = api_delete_status
            print('response---------',response, response['status_code'])
            if response['status_code'] == 200:
                obj.delete()
                self.message_user(request, f"Successfully deleted {obj}.", level='success')
                return HttpResponseRedirect(request.path)
            else:
                self.message_user(request, f"Failed to delete mailbox {obj}. Contact Helpdesk", level='error')    
        except Exception as e:
            # Handle deletion failure
            self.message_user(request, f"Failed to delete {obj}. Error: {str(e)}", level='error')
        return HttpResponseRedirect(reverse('admin:%s_%s_changelist' % (obj._meta.app_label, obj._meta.model_name)))

This code is displaying correctly for the delete_queryset on failure of deletion. But when we delete the mailbox object in the model admin page after confirm_delete(confirm_delete.html), the message displayed after returning to the listing page are:

Failed to delete mailbox [email protected]. Contact Helpdesk

as well as

The mailbox “[email protected]” was deleted successfully.

Failure is the expected result. But why does django also display successful deletion? How to hide this message in the modeladmin listing page for failed cases?

Deletion from queryset works as expected. Displays the failed message only

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật