Changeset - 52376dff592a
[Not reviewed]
0 1 0
Christopher Neugebauer - 7 years ago 2016-12-07 06:39:13
chrisjrn@gmail.com
Adds nag mails to the UI.

Fixes #50
1 file changed with 10 insertions and 0 deletions:
0 comments (0 inline, 0 general)
registrasion/reporting/views.py
Show inline comments
...
 
@@ -582,24 +582,34 @@ def attendee_data(request, form, user_id=None):
 
    categories = form.cleaned_data["category"]
 
    fields = form.cleaned_data["fields"]
 
    name_field = AttendeeProfile.name_field()
 

	
 
    items = commerce.ProductItem.objects.filter(
 
        Q(product__in=products) | Q(product__category__in=categories),
 
    ).exclude(
 
        cart__status=commerce.Cart.STATUS_RELEASED
 
    ).select_related(
 
        "cart", "cart__user", "product", "product__category",
 
    ).order_by("cart__status")
 

	
 
    # Add invoice nag link
 
    links = []
 
    links.append((
 
        reverse(views.nag_unpaid, args=[]) + "?" + request.META["QUERY_STRING"],
 
        "Send invoice reminders",
 
    ))
 

	
 
    if items.count() > 0:
 
        output.append(Links("Actions", links))
 

	
 
    # Make sure we select all of the related fields
 
    related_fields = set(
 
        field for field in fields
 
        if isinstance(AttendeeProfile._meta.get_field(field), RelatedField)
 
    )
 

	
 
    # Get all of the relevant attendee profiles in one hit.
 
    profiles = AttendeeProfile.objects.filter(
 
        attendee__user__cart__productitem__in=items
 
    ).select_related("attendee__user").prefetch_related(*related_fields)
 
    by_user = {}
 
    for profile in profiles:
0 comments (0 inline, 0 general)