Files @ 2aae2af55dea
Branch filter:

Location: symposion_app/vendor/symposion/reviews/context_processors.py

James Polley
Disable client-side validation on credit_note forms

* HTML5 browsers have some clevers to do client-side validation of
forms
* Django activates this by default for certain field types
* However, in this case, there are three forms on this page. We rely
on two of them being invalid in order to figure out what processing
to do.
* So we need to disable the client-side validation.
from symposion.proposals.models import ProposalSection


def reviews(request):
    sections = []
    manage_sections = {}
    for section in ProposalSection.objects.all():
        if request.user.has_perm("reviews.can_review_%s" % section.section.slug):
            sections.append(section)
        if request.user.has_perm("reviews.can_manage_%s" % section.section.slug):
            manage_sections.setdefault(section, []).append
    return {
        "review_sections": sections,
        "manage_sections": manage_sections
    }