Aurélien Bompard has proposed merging lp:~abompard/postorius/bug-1175967 into
lp:postorius.
Requested reviews:
Mailman Coders (mailman-coders)
For more details, see:
https://code.launchpad.net/~abompard/postorius/bug-1175967/+merge/242710
Fix bug #1175967: owners is not part of a list's settings.
--
Your team Mailman Coders is requested to review the proposed merge of
lp:~abompard/postorius/bug-1175967 into lp:postorius.
=== modified file 'src/postorius/doc/development.rst'
--- src/postorius/doc/development.rst 2012-11-04 19:54:09 +0000
+++ src/postorius/doc/development.rst 2014-11-24 20:47:49 +0000
@@ -151,7 +151,7 @@
>>> mailman_dev = client.get_list('[email protected]')
>>> print mailman_dev settings
- {u'owner_address': u'[email protected]',
+ {u'description': u'Mailman development',
u'default_nonmember_action': u'hold', ...}
For detailed information how to use mailman.client, check out its documentation_.
=== modified file 'src/postorius/templates/postorius/login.html'
--- src/postorius/templates/postorius/login.html 2014-04-14 15:25:26 +0000
+++ src/postorius/templates/postorius/login.html 2014-11-24 20:47:49 +0000
@@ -8,15 +8,17 @@
<p><strong>Login with username and password or with Mozilla Persona</strong></p>
<div class="mm_login">
+
<form action="" method="post" class="login mm_clear well"> {% csrf_token %}
{{ form.as_p }}
<div class="field">
- <button class="btn btn-primary" type="submit">{% trans "Login" %}</button>
+ <button class="btn btn-primary" type="submit">{% trans "Log in" %}</button>
</div>
</form>
- </div>
-
- <div class="mm_login_b">
+
+ </div>
+
+ <div class="mm_login_b">
<form method="post" action="{% url 'socialauth_complete' "browserid" %}"> {% csrf_token %}
<input type="hidden" name="assertion" value="" />
<a rel="nofollow" id="browserid" href="#"><img src="{% static 'postorius/img/sign_in_blue.png' %}" alt="Login using BrowserID" /></a>
=== modified file 'src/postorius/tests/mailman_api_tests/test_list_new.py'
--- src/postorius/tests/mailman_api_tests/test_list_new.py 2014-11-19 11:01:19 +0000
+++ src/postorius/tests/mailman_api_tests/test_list_new.py 2014-11-24 20:47:49 +0000
@@ -55,3 +55,4 @@
self.client.post(reverse('list_new'), post_data)
a_new_list = self.mm_client.get_list('[email protected]')
self.assertEqual(a_new_list.fqdn_listname, u'[email protected]')
+ self.assertEqual(a_new_list.owners, [u'[email protected]'])
=== modified file 'src/postorius/urls.py'
--- src/postorius/urls.py 2014-04-17 22:12:20 +0000
+++ src/postorius/urls.py 2014-11-24 20:47:49 +0000
@@ -19,6 +19,7 @@
from django.conf.urls import *
from django.conf import settings
from django.conf.urls.static import static
+from django.contrib.auth.views import login as login_view
from postorius.views import *
from postorius.views.generic import *
@@ -82,7 +83,7 @@
'postorius.views',
(r'^$', 'list_index'),
# /account/
- url(r'^accounts/login/$', 'user_login', name='user_login'),
+ url(r'^accounts/login/$', login_view, {"template_name": "postorius/login.html"}, name='user_login'),
url(r'^accounts/logout/$', 'user_logout', name='user_logout'),
url(r'^accounts/profile/$', 'user_profile', name='user_profile'),
url(r'^tasks/$', 'user_tasks', name='user_tasks'),
=== modified file 'src/postorius/views/list.py'
--- src/postorius/views/list.py 2014-11-03 21:17:11 +0000
+++ src/postorius/views/list.py 2014-11-24 20:47:49 +0000
@@ -306,10 +306,9 @@
try:
mailing_list = domain.create_list(
form.cleaned_data['listname'])
+ mailing_list.add_owner(form.cleaned_data['list_owner'])
list_settings = mailing_list.settings
list_settings["description"] = form.cleaned_data['description']
- list_settings["owner_address"] = \
- form.cleaned_data['list_owner']
list_settings["advertised"] = form.cleaned_data['advertised']
list_settings.save()
messages.success(request, _("List created"))
=== modified file 'src/postorius/views/user.py'
--- src/postorius/views/user.py 2014-04-19 16:59:56 +0000
+++ src/postorius/views/user.py 2014-11-24 20:47:49 +0000
@@ -25,7 +25,6 @@
from django.contrib.auth import logout, authenticate, login
from django.contrib.auth.decorators import (login_required,
user_passes_test)
-from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.models import User
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
@@ -308,21 +307,6 @@
return redirect('user_login')
-def user_login(request, template='postorius/login.html'):
- if request.method == 'POST':
- form = AuthenticationForm(request.POST)
- user = authenticate(username=request.POST.get('username'),
- password=request.POST.get('password'))
- if user is not None:
- if user.is_active:
- login(request, user)
- return redirect(request.GET.get('next', 'list_index'))
- else:
- form = AuthenticationForm()
- return render_to_response(template, {'form': form},
- context_instance=RequestContext(request))
-
-
@login_required()
def user_profile(request, user_email=None):
if not request.user.is_authenticated():
_______________________________________________
Mailman-coders mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-coders