2017-09-23 21:40:45 +02:00
|
|
|
from django.contrib import admin
|
2024-10-23 11:06:57 +02:00
|
|
|
|
2017-09-24 18:20:10 +02:00
|
|
|
from . import models
|
2017-09-23 21:40:45 +02:00
|
|
|
|
2017-09-24 18:20:10 +02:00
|
|
|
|
|
|
|
@admin.register(models.ApiKey)
|
|
|
|
class ApiKeyAdmin(admin.ModelAdmin):
|
2024-10-23 11:06:57 +02:00
|
|
|
list_display = ["name", "last_used", "displayValue"]
|
|
|
|
readonly_fields = ["keyId", "key", "last_used", "displayValue"]
|
2017-09-24 18:20:10 +02:00
|
|
|
|
|
|
|
def save_model(self, request, obj, form, change):
|
|
|
|
if not change:
|
|
|
|
obj.initialFill()
|
2024-10-23 13:21:36 +02:00
|
|
|
super().save_model(request, obj, form, change)
|