Add Recipient.access_type (restricted/public) and an AllowedUser table linking users to the recipients they may be paid through. Restricted recipients are now checked against AllowedUser both when computing a promotion payout and in the event-status endpoints that report eligibility before submission. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
22 lines
698 B
Python
22 lines
698 B
Python
from functools import update_wrapper
|
|
|
|
from django.contrib import admin
|
|
|
|
from .models import Promotion, Plan, Event, Recipient, EventSaver, AllowedUser
|
|
|
|
class PromotionAdmin(admin.ModelAdmin):
|
|
list_display = ['user_uuid', 'plan', 'promotion_amount', 'recipient', 'event', 'created_at']
|
|
|
|
class PlanAdmin(admin.ModelAdmin):
|
|
list_display = ['uuid', 'title', 'balance']
|
|
|
|
class AllowedUserAdmin(admin.ModelAdmin):
|
|
list_display = ['user', 'recipient', 'created_at']
|
|
|
|
admin.site.register(Plan, PlanAdmin)
|
|
admin.site.register(Promotion, PromotionAdmin)
|
|
admin.site.register(Event)
|
|
admin.site.register(EventSaver)
|
|
admin.site.register(Recipient)
|
|
admin.site.register(AllowedUser, AllowedUserAdmin)
|
|
|