Files @ 2aae2af55dea
Branch filter:

Location: symposion_app/vendor/symposion/reviews/admin.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 django.contrib import admin

from symposion.reviews.models import NotificationTemplate, ProposalResult, ResultNotification, Review


admin.site.register(
    NotificationTemplate,
    list_display=[
        'label',
        'from_address',
        'subject'
    ]
)

admin.site.register(
    ProposalResult,
    list_display=['proposal', 'status', 'score', 'vote_count', 'accepted']
)

admin.site.register(
    ResultNotification,
    list_display=['proposal','timestamp','to_address','subject'],
    search_fields = ['proposal__title','to_address','subject'],
    readonly_fields = ['proposal','timestamp','template','to_address','from_address','subject','body']
)

admin.site.register(
    Review,
    list_display=[
        'proposal',
        'user',
        'vote',
        'submitted_at',
    ]
)