diff --git a/src/backoffice/templates/approve_public_credit_names.html b/src/backoffice/templates/approve_public_credit_names.html new file mode 100644 index 00000000..0ed6beb8 --- /dev/null +++ b/src/backoffice/templates/approve_public_credit_names.html @@ -0,0 +1,42 @@ +{% extends 'base.html' %} +{% load commonmark %} +{% load static from staticfiles %} +{% load imageutils %} +{% block extra_head %} + + +{% endblock extra_head %} +{% block content %} +
Username | +Public Credit Name | +Actions | +|
---|---|---|---|
{{ profile.user.username }} | +{{ profile.user.email }} | +{{ profile.public_credit_name }} | ++ Open In Admin + | +
Use this view to mark badges as handed out.
+ +Use this view to check and approve users Public Credit Names
+ diff --git a/src/backoffice/urls.py b/src/backoffice/urls.py index e1af8680..e366e471 100644 --- a/src/backoffice/urls.py +++ b/src/backoffice/urls.py @@ -9,5 +9,6 @@ urlpatterns = [ url(r'product_handout/$', ProductHandoutView.as_view(), name='product_handout'), url(r'badge_handout/$', BadgeHandoutView.as_view(), name='badge_handout'), url(r'ticket_checkin/$', TicketCheckinView.as_view(), name='ticket_checkin'), + url(r'public_credit_names/$', ApproveNamesView.as_view(), name='public_credit_names'), ] diff --git a/src/backoffice/views.py b/src/backoffice/views.py index dfb3de69..e08ced5f 100644 --- a/src/backoffice/views.py +++ b/src/backoffice/views.py @@ -2,6 +2,7 @@ from django.views.generic import TemplateView, ListView from django.http import HttpResponseForbidden from shop.models import OrderProductRelation from tickets.models import ShopTicket, SponsorTicket, DiscountTicket +from profiles.models import Profile from itertools import chain import logging logger = logging.getLogger("bornhack.%s" % __name__) @@ -44,3 +45,11 @@ class TicketCheckinView(StaffMemberRequiredMixin, ListView): discounttickets = DiscountTicket.objects.filter(checked_in=False) return list(chain(shoptickets, sponsortickets, discounttickets)) + +class ApproveNamesView(StaffMemberRequiredMixin, ListView): + template_name = "approve_public_credit_names.html" + context_object_name = 'profiles' + + def get_queryset(self, **kwargs): + return Profile.objects.filter(public_credit_name_approved=False).exclude(public_credit_name='') +