bornhack-website/src/profiles/admin.py
Thomas Steen Rasmussen 00af109e2f
add flake8 and isort to pre-commit config, make flake8 and isort happy (#441)
* add flake8 to pre-commit config, and fixup many things to make flake8 happy

* add isort and sort all imports, add to pre-commit and requirements
2020-02-12 13:10:41 +01:00

25 lines
640 B
Python

from django.contrib import admin
from .models import Profile
@admin.register(Profile)
class OrderAdmin(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)"