Commit f099ceaa authored by Aurélien Bompard's avatar Aurélien Bompard

Domain.base_url is deprecated

parent 15beb1ec
......@@ -68,13 +68,6 @@ class DomainNew(FieldsetForm):
required=True,
help_text=_('Example: domain.org'),
)
web_host = forms.URLField(
label=_('Web Host'),
error_messages={'required': _('Please enter a host name'),
'invalid': _('Please enter a valid host name.')},
required=False,
help_text=_('Example: http://www.domain.org'),
)
description = forms.CharField(
label=_('Description'),
required=False)
......@@ -98,7 +91,6 @@ class DomainNew(FieldsetForm):
"""
layout = [["Please enter Details",
"mail_host",
"web_host",
"description"]]
......
......@@ -20,20 +20,13 @@ from __future__ import (
absolute_import, division, print_function, unicode_literals)
import uuid
import logging
from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.core.exceptions import ImproperlyConfigured
from django.core.mail import send_mail
from django.db.models.signals import post_save
from django.core.urlresolvers import reverse
from django.dispatch import receiver
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
try:
......
......@@ -18,7 +18,6 @@
<thead>
<tr>
<th>{% trans 'Mail Host' %}</th>
<th>{% trans 'URL Host' %}</th>
<th>{% trans 'Description' %}</th>
<th>&nbsp;</th>
</tr>
......@@ -27,7 +26,6 @@
{% for domain in domains %}
<tr>
<td>{{ domain.mail_host }}</td>
<td>{{ domain.base_url }}</td>
<td>{{ domain.description }}</td>
<td><a href="{% url 'domain_delete' domain.mail_host %}" class="btn btn-xs btn-danger">{% trans 'Delete' %}</a></td>
</tr>
......
......@@ -37,24 +37,14 @@ class UserPreferencesTest(TestCase):
class DomainNewTest(TestCase):
def test_form_fields_webhost(self):
def test_form_fields_valid(self):
form = DomainNew({
'mail_host': 'mailman.most-desirable.org',
'web_host': 'http://mailman.most-desirable.org',
'description': 'The Most Desirable organization',
'contact_address': 'contact@mailman.most-desirable.org',
})
self.assertTrue(form.is_valid())
def test_form_fields_webhost_invalid(self):
form = DomainNew({
'mail_host': 'mailman.most-desirable.org',
'web_host': 'most-desirable',
'description': 'The Most Desirable organization',
'contact_address': 'contact@mailman.most-desirable.org',
})
self.assertFalse(form.is_valid())
class ListSubscribeTest(TestCase):
def test_subscribe_works(self):
......
......@@ -44,11 +44,9 @@ def create_mock_domain(properties=None):
:rtype: MagicMock
"""
mock_object = MagicMock(name='Domain')
mock_object.base_url = ''
mock_object.contact_address = ''
mock_object.description = ''
mock_object.mail_host = ''
mock_object.url_host = ''
mock_object.lists = []
if properties is not None:
for key in properties:
......
......@@ -52,7 +52,6 @@ def domain_new(request):
form = DomainNew(request.POST)
if form.is_valid():
domain = Domain(mail_host=form.cleaned_data['mail_host'],
base_url=form.cleaned_data['web_host'],
description=form.cleaned_data['description'],
owner=request.user.email)
try:
......
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