Commit ce9e17ea authored by Sli's avatar Sli

Some mailing list fixs

parent 9e515915
......@@ -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>
......
......@@ -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 %}
......
......@@ -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():
......
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