contacts: Allow email via POST or GET parameters

This commit is contained in:
Ben Sturmfels 2024-04-09 23:06:52 +10:00
parent 789d0c8c84
commit 9c01770b3c
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0

View file

@ -21,7 +21,7 @@ def unsubscribe(request):
if request.method == 'POST': if request.method == 'POST':
logger.debug('Unsubscribe GET: %s', request.GET) logger.debug('Unsubscribe GET: %s', request.GET)
logger.debug('Unsubscribe POST: %s', request.POST) logger.debug('Unsubscribe POST: %s', request.POST)
form = UnsubscribeForm(request.POST) form = UnsubscribeForm(request.GET | request.POST)
if form.is_valid(): if form.is_valid():
form.save() form.save()
logger.info('Unsubscribed %s', form.cleaned_data['email']) logger.info('Unsubscribed %s', form.cleaned_data['email'])