Commit d13c7621 authored by jocelyn's avatar jocelyn

maillists : ajoute du logging en cas d'erreur de synchro

parent ce7740fb
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required
......@@ -10,6 +11,7 @@ from django.shortcuts import render, redirect
from .models import MaillingList, MaillingListSubscription, SyncCommandError
from coin.members.models import Member
logger = logging.getLogger(__name__)
class SubscriptionForm(forms.Form):
subscribed = forms.BooleanField(widget=forms.Select(choices=(
......@@ -58,6 +60,7 @@ def lists_list(request):
to_remove = old_subscriptions - new_subscriptions
MaillingListSubscription.objects.filter(member=request.user, maillinglist__in=to_remove).delete()
except SyncCommandError as e:
logger.error(e)
messages.error(
request,
"Impossible de sauvegarder tes abonnements. "
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment