# -*- coding: utf-8 -*-
from __future__ import annotations

from django.contrib import admin

from hotpocket_backend.apps.accounts.models import AccessToken


class AccessTokenAdmin(admin.ModelAdmin):
    list_display = ('pk', 'account_uuid', 'origin', 'created_at', 'is_active')
    search_fields = ('pk', 'account_uuid', 'key', 'origin')

    def has_delete_permission(self, request, obj=None):
        return request.user.is_superuser


admin.site.register(AccessToken, AccessTokenAdmin)
