Some mailing list fixs

This commit is contained in:
Antoine Bartuccio 2017-08-21 14:19:49 +02:00
parent 9e5159152a
commit ce9e17ea24
3 changed files with 4 additions and 4 deletions

View File

@ -5,7 +5,7 @@
{% endblock %}
{% block content %}
<h1>{% trans %}This page list all existing mailing lists{% endtrans %}</h1>
<h1>{% trans %}This page lists all existing mailing lists{% endtrans %}</h1>
{% if has_objects %}
<table>
<tr>

View File

@ -62,7 +62,7 @@
{% if profile.mailing_subscriptions.exists() and (profile.id == user.id or user.is_root or self.user.is_in_group(settings.SITH_GROUP_COM_ADMIN_ID)) %}
<h4>{% trans %}Subscribed mailing lists{% endtrans %}</h4>
{% for sub in profile.mailing_subscriptions.all() %}
<p>{{ sub.mailing.email }} <a href="{{ url('club:mailing_subscription_delete', mailing_subscription_id=sub.id) }}">{% trans %}Unsuscribe{% endtrans %}</a></p>
<p>{{ sub.mailing.email }} <a href="{{ url('club:mailing_subscription_delete', mailing_subscription_id=sub.id) }}">{% trans %}Unsubscribe{% endtrans %}</a></p>
{% endfor %}
{% endif %}
{% endblock %}

View File

@ -1353,7 +1353,7 @@ def migrate_mailings():
club = club.first()
if mailing['nom']:
mailing['nom'] = '.' + mailing['nom']
Mailing(id=mailing['id_mailing'], club=club, email=str(club.unix_name + mailing['nom'] + '@utbm.fr')).save()
Mailing(id=mailing['id_mailing'], club=club, email=to_unicode(club.unix_name + mailing['nom'] + '@utbm.fr')).save()
print("-------------------")
cur.execute("""
@ -1369,7 +1369,7 @@ def migrate_mailings():
user = User.objects.get(id=mailing_sub['id_user'])
MailingSubscription(mailing=mailing, user=user, email=user.email).save()
elif mailing_sub['email']:
MailingSubscription(mailing=mailing, email=mailing_sub['email']).save()
MailingSubscription(mailing=mailing, email=to_unicode(mailing_sub['email'])).save()
def main():