From 4e74762d5356faa5e366b773c011e8c706846cb0 Mon Sep 17 00:00:00 2001 From: Ekaropolus Date: Sat, 5 Jul 2025 21:49:11 -0600 Subject: [PATCH] Eliminate button for the webhook action admin screen --- pxy_bots/admin.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/pxy_bots/admin.py b/pxy_bots/admin.py index 9989569..0b3ea93 100644 --- a/pxy_bots/admin.py +++ b/pxy_bots/admin.py @@ -1,10 +1,9 @@ from django.contrib import admin from .models import TelegramBot -from django.utils.html import format_html @admin.register(TelegramBot) class TelegramBotAdmin(admin.ModelAdmin): - list_display = ("name", "username", "is_active", "get_assistant_name", "set_webhook_action") + list_display = ("name", "username", "is_active", "get_assistant_name") search_fields = ("name", "username") list_filter = ("is_active",) actions = ["set_webhooks"] @@ -45,11 +44,3 @@ class TelegramBotAdmin(admin.ModelAdmin): """Show the name of the assistant linked to the bot.""" return obj.assistant.name if obj.assistant else "None" get_assistant_name.short_description = "Assistant Name" - - def set_webhook_action(self, obj): - """Button in the Django admin to manually trigger webhook setup.""" - return format_html( - 'Set Webhook', - f"/admin/pxy_bots/set_webhook/{obj.id}/" - ) - set_webhook_action.short_description = "Webhook"