mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 22:23:23 +00:00
Some mailing list fixs
This commit is contained in:
parent
9e5159152a
commit
ce9e17ea24
@ -5,7 +5,7 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% 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 %}
|
{% if has_objects %}
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<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)) %}
|
{% 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>
|
<h4>{% trans %}Subscribed mailing lists{% endtrans %}</h4>
|
||||||
{% for sub in profile.mailing_subscriptions.all() %}
|
{% 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 %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -1353,7 +1353,7 @@ def migrate_mailings():
|
|||||||
club = club.first()
|
club = club.first()
|
||||||
if mailing['nom']:
|
if mailing['nom']:
|
||||||
mailing['nom'] = '.' + 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("-------------------")
|
print("-------------------")
|
||||||
|
|
||||||
cur.execute("""
|
cur.execute("""
|
||||||
@ -1369,7 +1369,7 @@ def migrate_mailings():
|
|||||||
user = User.objects.get(id=mailing_sub['id_user'])
|
user = User.objects.get(id=mailing_sub['id_user'])
|
||||||
MailingSubscription(mailing=mailing, user=user, email=user.email).save()
|
MailingSubscription(mailing=mailing, user=user, email=user.email).save()
|
||||||
elif mailing_sub['email']:
|
elif mailing_sub['email']:
|
||||||
MailingSubscription(mailing=mailing, email=mailing_sub['email']).save()
|
MailingSubscription(mailing=mailing, email=to_unicode(mailing_sub['email'])).save()
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
Reference in New Issue
Block a user