00af109e2f
* 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
25 lines
640 B
Python
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)"
|