Files @ a8710b4b9f2a
Branch filter:

Location: website/www/conservancy/apps/contacts/views.py

Denver Gingerich
Copyleft Compliance: mostly minor fixes to new pgs

These are mostly minor edits (typo fixes, etc.) to the enforcement
strategy and firmware liberation pages that were just added.

The one large change was to replace the first paragraph of the
enforcement strategy page with the full Conservancy description used
previously. The glue text used to shorten it appeared unsalvageable
and it wasn't immediately obvious how to replace it with something
better, so we used the full description instead.
from django.shortcuts import render
from django import forms
from conservancy.apps.contacts.models import ContactEntry
from django.forms import ModelForm

def subscribe(request):
    """Mailing list subscription form
    """

    class ContactEntryForm(ModelForm):
        class Meta:
            model = ContactEntry

    ContactEntryForm.base_fields['subscribe_conservancy'].label = 'Receive Software Freedom Conservancy updates'

    if request.method == 'POST':
        form = ContactEntryForm(request.POST)
        if form.is_valid():
            form.save()
            return render(request, 'contacts/subscribe_success.html', {'form': form.cleaned_data})
    else:
        form = ContactEntryForm()

    return render(request, 'contacts/subscribe.html', {'form': form})