diff --git a/src/postorius/management/commands/mmclient.py b/src/postorius/management/commands/mmclient.py index 69b24ac..05bb297 100644 --- a/src/postorius/management/commands/mmclient.py +++ b/src/postorius/management/commands/mmclient.py @@ -17,7 +17,7 @@ # Postorius. If not, see . from django.core.management.base import BaseCommand -from postorius import utils +from django_mailman3.lib.mailman import get_mailman_client class Command(BaseCommand): @@ -42,7 +42,7 @@ shell = code.InteractiveConsole(globals()) console_fn = shell.interact # connect to mailmanclient - client = utils.get_client() + client = get_mailman_client() # Putting client back in the global scope globals()['client'] = client # run the interpreter diff --git a/src/postorius/models.py b/src/postorius/models.py index 854dcc8..b0ce8de 100644 --- a/src/postorius/models.py +++ b/src/postorius/models.py @@ -33,8 +33,8 @@ from django.db import models from django.http import Http404 from django.template.loader import render_to_string +from django_mailman3.lib.mailman import get_mailman_client from mailmanclient import MailmanConnectionError -from postorius.utils import get_client try: from urllib2 import HTTPError except ImportError: @@ -81,7 +81,7 @@ def all(self): try: - return getattr(get_client(), self.resource_name_plural) + return getattr(get_mailman_client(), self.resource_name_plural) except AttributeError: raise MailmanApiError except MailmanConnectionError as e: @@ -89,7 +89,7 @@ def get(self, *args, **kwargs): try: - method = getattr(get_client(), 'get_' + self.resource_name) + method = getattr(get_mailman_client(), 'get_' + self.resource_name) return method(*args, **kwargs) except AttributeError as e: raise MailmanApiError(e) @@ -113,7 +113,8 @@ def create(self, *args, **kwargs): try: - method = getattr(get_client(), 'create_' + self.resource_name) + method = getattr( + get_mailman_client(), 'create_' + self.resource_name) return method(*args, **kwargs) except AttributeError as e: raise MailmanApiError(e) @@ -139,7 +140,7 @@ def all(self, only_public=False): try: - objects = getattr(get_client(), self.resource_name_plural) + objects = getattr(get_mailman_client(), self.resource_name_plural) except AttributeError: raise MailmanApiError except MailmanConnectionError as e: diff --git a/src/postorius/templates/postorius/domain/new.html b/src/postorius/templates/postorius/domain/new.html index 50f2802..5b514d1 100644 --- a/src/postorius/templates/postorius/domain/new.html +++ b/src/postorius/templates/postorius/domain/new.html @@ -13,7 +13,7 @@
- {% render_form_horizontal form 2 8 'Create domain' %} + {% bootstrap_form_horizontal form 2 8 'Create domain' %}
{% endblock main %} diff --git a/src/postorius/templates/postorius/lib/form-horizontal.html b/src/postorius/templates/postorius/lib/form-horizontal.html deleted file mode 100644 index 839e52a..0000000 --- a/src/postorius/templates/postorius/lib/form-horizontal.html +++ /dev/null @@ -1,56 +0,0 @@ -{% load i18n %} -{% load bootstrap_tags %} - -{% if form.non_field_errors %} -
{{ form.non_field_errors }}
-{% endif %} - -{% csrf_token %} -{% for hidden in form.hidden_fields %} - {{ hidden }} -{% endfor %} - -{% for field in form.visible_fields %} -
- -
- {% if field|fieldtype == 'RadioSelect' %} - {% for choice in field %} - - {% endfor %} - {% elif field|fieldtype == 'CheckboxSelectMultiple' %} - {% for choice in field %} -
- -
- {% endfor %} - {% else %} - {{ field|add_form_control }} - {% endif %} - {% for error in field.errors %} -
{{ error }}
- {% endfor %} -
- {% if field.help_text %} -

- {{ field.help_text|linebreaksbr }} -

- {% endif %} -
-{% endfor %} -{% if button %} -
-
- -
-
-{% endif %} diff --git a/src/postorius/templates/postorius/lists/mass_removal.html b/src/postorius/templates/postorius/lists/mass_removal.html index 24ceac9..c1328b7 100644 --- a/src/postorius/templates/postorius/lists/mass_removal.html +++ b/src/postorius/templates/postorius/lists/mass_removal.html @@ -8,7 +8,7 @@ {% list_nav 'list_mass_ops' 'Mass Removal' %}
- {% render_form_horizontal form 2 8 %} + {% bootstrap_form_horizontal form 2 8 %}
diff --git a/src/postorius/templates/postorius/lists/mass_subscribe.html b/src/postorius/templates/postorius/lists/mass_subscribe.html index 0971642..521b958 100644 --- a/src/postorius/templates/postorius/lists/mass_subscribe.html +++ b/src/postorius/templates/postorius/lists/mass_subscribe.html @@ -12,7 +12,7 @@ {% list_nav 'list_mass_ops' 'Mass subscription' %} - {% render_form_horizontal form 2 8 'Subscribe users' %} + {% bootstrap_form_horizontal form 2 8 'Subscribe users' %} {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/memberoptions.html b/src/postorius/templates/postorius/lists/memberoptions.html index ac95262..70175c9 100644 --- a/src/postorius/templates/postorius/lists/memberoptions.html +++ b/src/postorius/templates/postorius/lists/memberoptions.html @@ -16,14 +16,14 @@

{% trans 'You are not the owner for this list' %}

{% else %}
- {% render_form_horizontal preferences_form 3 8 'Save changes' %} + {% bootstrap_form_horizontal preferences_form 3 8 'Save changes' %}
Administration options
- {% render_form_horizontal moderation_form 3 8 'Save changes' %} + {% bootstrap_form_horizontal moderation_form 3 8 'Save changes' %}
diff --git a/src/postorius/templates/postorius/lists/new.html b/src/postorius/templates/postorius/lists/new.html index c7eb1b3..012a1e2 100644 --- a/src/postorius/templates/postorius/lists/new.html +++ b/src/postorius/templates/postorius/lists/new.html @@ -13,7 +13,7 @@
- {% render_form_horizontal form 2 8 'Create list' %} + {% bootstrap_form_horizontal form 2 8 'Create list' %}
{% endblock %} diff --git a/src/postorius/templates/postorius/lists/settings.html b/src/postorius/templates/postorius/lists/settings.html index 35ca5cb..1fd1c18 100644 --- a/src/postorius/templates/postorius/lists/settings.html +++ b/src/postorius/templates/postorius/lists/settings.html @@ -19,7 +19,7 @@
- {% render_form_horizontal form 3 8 'Save changes' %} + {% bootstrap_form_horizontal form 3 8 'Save changes' %}
{% endblock %} diff --git a/src/postorius/templates/postorius/lists/summary.html b/src/postorius/templates/postorius/lists/summary.html index a3b7d06..5f46500 100644 --- a/src/postorius/templates/postorius/lists/summary.html +++ b/src/postorius/templates/postorius/lists/summary.html @@ -55,7 +55,7 @@ {% endblocktrans %}

- {% render_form_horizontal subscribe_form 2 8 'Subscribe' %} + {% bootstrap_form_horizontal subscribe_form 2 8 'Subscribe' %}
{% endif %} {% else %} diff --git a/src/postorius/templates/postorius/login.html b/src/postorius/templates/postorius/login.html index 34c760e..4f46af3 100644 --- a/src/postorius/templates/postorius/login.html +++ b/src/postorius/templates/postorius/login.html @@ -21,7 +21,7 @@
- {% render_form_horizontal form 4 8 'Log in' %} + {% bootstrap_form_horizontal form 4 8 'Log in' %}