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 16:19:50 +02:00

17 lines
400 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.tobytes()
def private_key_view(self, obj):
return obj.private_key.tobytes()
admin.site.register(VAPIDKeyset, VAPIDKeysetAdmin)