This repository has been archived on 2021-04-21. You can view files and clone it, but cannot push or open issues or pull requests.
djangoldp-webpushnotification/djangoldp_webpushnotification/admin.py
2021-04-07 17:18:09 +02:00

20 lines
467 B
Python

from django.contrib import admin
from djangoldp.admin import DjangoLDPAdmin
from .models import VAPIDKeyset
class VAPIDKeysetAdmin(DjangoLDPAdmin):
readonly_fields = ('public_key_view', 'private_key_view')
def public_key_view(self, obj):
return obj.public_key
def private_key_view(self, obj):
return obj.private_key.tobytes()
class Meta:
verbose_name = 'VAPID key-set'
admin.site.register(VAPIDKeyset, VAPIDKeysetAdmin)