diff --git a/dev_requirements.txt b/dev_requirements.txt new file mode 100644 index 0000000..b1d7367 --- /dev/null +++ b/dev_requirements.txt @@ -0,0 +1,3 @@ +coverage +django_nose +mock diff --git a/setup.py b/setup.py index f906146..5b73b89 100644 --- a/setup.py +++ b/setup.py @@ -37,5 +37,5 @@ include_package_data = True, install_requires = ['django>=1.4', 'django-social-auth>=0.7.8', - 'mailmanclient', ] + 'mailmanclient'] ) diff --git a/src/postorius/auth/decorators.py b/src/postorius/auth/decorators.py index 2b0c2c6..bded4aa 100644 --- a/src/postorius/auth/decorators.py +++ b/src/postorius/auth/decorators.py @@ -51,14 +51,14 @@ """ def wrapper(*args, **kwargs): user = args[0].user - fqdn_listname = kwargs['fqdn_listname'] + list_id = kwargs['list_id'] if not user.is_authenticated(): raise PermissionDenied if user.is_superuser: return fn(*args, **kwargs) if getattr(user, 'is_list_owner', None): return fn(*args, **kwargs) - mlist = List.objects.get_or_404(fqdn_listname=fqdn_listname) + mlist = List.objects.get_or_404(fqdn_listname=list_id) if user.email not in mlist.owners: raise PermissionDenied else: @@ -69,12 +69,12 @@ def list_moderator_required(fn): """Check if the logged in user is a moderator of the given list. - Assumes that the request object is the first arg and that fqdn_listname + Assumes that the request object is the first arg and that list_id is present in kwargs. """ def wrapper(*args, **kwargs): user = args[0].user - fqdn_listname = kwargs['fqdn_listname'] + list_id = kwargs['list_id'] if not user.is_authenticated(): raise PermissionDenied if user.is_superuser: @@ -83,7 +83,7 @@ return fn(*args, **kwargs) if getattr(user, 'is_list_moderator', None): return fn(*args, **kwargs) - mlist = List.objects.get_or_404(fqdn_listname=fqdn_listname) + mlist = List.objects.get_or_404(fqdn_listname=list_id) if user.email not in mlist.moderators and \ user.email not in mlist.owners: raise PermissionDenied diff --git a/src/postorius/doc/news.rst b/src/postorius/doc/news.rst index 04edcb2..35d2fa0 100644 --- a/src/postorius/doc/news.rst +++ b/src/postorius/doc/news.rst @@ -30,6 +30,7 @@ * Fix adding the a list owner on list creation. Contributed by Aurélien Bompard (LP: 1175967). * Fix untranslatable template strings. Contributed by Sumana Harihareswara (LP: 1157947). * Fix wrong labels in metrics template. Contributed by Sumana Harihareswara (LP: 1409033). +* URLs now contain the list-id instead of the fqdn_listname. Contributed by Abhilash Raj (LP: 1201150). 1.0 beta 1 -- "Year of the Parrot" diff --git a/src/postorius/templates/postorius/lists/confirm_delete.html b/src/postorius/templates/postorius/lists/confirm_delete.html index f03d794..d868e29 100644 --- a/src/postorius/templates/postorius/lists/confirm_delete.html +++ b/src/postorius/templates/postorius/lists/confirm_delete.html @@ -10,6 +10,6 @@
{% trans "All settings and membership data will be lost!" %}
{% endblock main %} diff --git a/src/postorius/templates/postorius/lists/confirm_remove_role.html b/src/postorius/templates/postorius/lists/confirm_remove_role.html index 4380f85..b7e1ccb 100644 --- a/src/postorius/templates/postorius/lists/confirm_remove_role.html +++ b/src/postorius/templates/postorius/lists/confirm_remove_role.html @@ -6,9 +6,9 @@ {% block main %}{% trans "Are you sure you want to remove?" %}
- {% endblock main %} diff --git a/src/postorius/templates/postorius/lists/index.html b/src/postorius/templates/postorius/lists/index.html index a962f44..052ce37 100644 --- a/src/postorius/templates/postorius/lists/index.html +++ b/src/postorius/templates/postorius/lists/index.html @@ -29,7 +29,7 @@ {% for list in lists %}