bornhack-website/src/profiles/admin.py
Thomas Steen Rasmussen c52bf300ff
Phonebook (#465)
* first version of dect registration and phonebook functionality, missing export functionality for dect phone system, the rest should more or less work

* add a missing button and message

* fix typo

* add django-oauth-toolkit to implement oauth2 auth for the DECT csv export

* remove unused HMAC code

* add logger

* only show buttons when user is logged in

* remove unneeded enctype
2020-03-05 12:31:11 +01:00

25 lines
642 B
Python

from django.contrib import admin
from .models import Profile
@admin.register(Profile)
class ProfileAdmin(admin.ModelAdmin):
actions = ["approve_public_credit_names"]
list_display = [
"user",
"name",
"description",
"public_credit_name",
"public_credit_name_approved",
]
list_filter = ["public_credit_name_approved"]
def approve_public_credit_names(self, request, queryset):
for profile in queryset.filter(public_credit_name_approved=False):
profile.approve_public_credit_name()
approve_public_credit_names.description = "Approve Public Credit Name(s)"