from django.contrib import admin
from django.utils.translation import gettext_lazy as _

from users.imports.admin import BaseModelAdmin as Parent
from users.models import NotificationLogModel


@admin.register(NotificationLogModel)
class NotificationLogModelAdmin(Parent):
    list_display = [
        'user',
        'platform',
        'status',
    ]
    list_display_links = [
        'user',
        'platform',
        'status',
    ]
    search_fields = [
        'user__id',
        'user__email_address',
        'user__phone_number',
        'user__username',
        'kwargs',
    ]
    list_filter = [
        'platform',
        'status',
    ]
    fieldsets = [
        (_('Info'), {
            'fields': [
                'user',
                'platform',
                'status',
                'kwargs',
            ]}),
    ]

    def has_delete_permission(self, request, obj=None):
        return False

    def has_change_permission(self, request, obj=None):
        return False

    def has_add_permission(self, request):
        return False

