bornhack-website/src/profiles/admin.py

23 lines
589 B
Python
Raw Normal View History

2015-10-03 01:07:05 +00:00
from django.contrib import admin
from .models import Profile
2018-03-04 14:50:05 +00:00
2017-07-11 20:50:31 +00:00
@admin.register(Profile)
class OrderAdmin(admin.ModelAdmin):
actions = ['approve_public_credit_names']
list_display = [
'user',
'name',
'description',
'public_credit_name',
'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)'
2015-10-03 01:07:05 +00:00