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"