diff options
-rw-r--r-- | license_protected_downloads/tests/test_views.py | 2 | ||||
-rw-r--r-- | license_protected_downloads/views.py | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/license_protected_downloads/tests/test_views.py b/license_protected_downloads/tests/test_views.py index 3d6e872..2d10920 100644 --- a/license_protected_downloads/tests/test_views.py +++ b/license_protected_downloads/tests/test_views.py @@ -633,7 +633,7 @@ class ViewHelpersTests(BaseServeViewTest): self.assertTrue(isinstance(response, HttpResponse)) self.assertContains( response, - "You need to be the member of one of the linaro batman, catwoman " + "You need to be the member of one of the linaro, batman, catwoman " "or joker groups", status_code=403) diff --git a/license_protected_downloads/views.py b/license_protected_downloads/views.py index e5a87cc..08c101b 100644 --- a/license_protected_downloads/views.py +++ b/license_protected_downloads/views.py @@ -98,10 +98,8 @@ def group_auth_failed_response(request, auth_groups): """Construct a nice response detailing list of auth groups that will allow access to the requested file.""" if len(auth_groups) > 1: - groups_string = "one of the " + auth_groups.pop(0) + " " - if len(auth_groups) > 1: - groups_string += ", ".join(auth_groups[0:-1]) - + groups_string = "one of the " + groups_string += ", ".join(auth_groups[0:-1]) groups_string += " or " + auth_groups[-1] + " groups" else: groups_string = "the " + auth_groups[0] + " group" |