From 170c4383c5c57a2315433634b4d516b2c0ee47fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Tue, 7 Jun 2022 10:42:48 +0200
Subject: [PATCH 2/2] misc: simplify urls

urls are already decorated in lingo.urls includes
---
 lingo/pricing/urls.py | 89 +++++++++++++++++++++----------------------
 1 file changed, 43 insertions(+), 46 deletions(-)

diff --git a/lingo/pricing/urls.py b/lingo/pricing/urls.py
index 4fbd28d..a7f4167 100644
--- a/lingo/pricing/urls.py
+++ b/lingo/pricing/urls.py
@@ -15,210 +15,207 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 from django.conf.urls import url
-from django.contrib.admin.views.decorators import staff_member_required
 
 from . import views
 
 urlpatterns = [
-    url(r'^$', staff_member_required(views.pricing_list), name='lingo-manager-pricing-list'),
-    url(r'^import/$', staff_member_required(views.config_import), name='lingo-manager-pricing-config-import'),
-    url(r'^export/$', staff_member_required(views.config_export), name='lingo-manager-pricing-config-export'),
+    url(r'^$', views.pricing_list, name='lingo-manager-pricing-list'),
+    url(r'^import/$', views.config_import, name='lingo-manager-pricing-config-import'),
+    url(r'^export/$', views.config_export, name='lingo-manager-pricing-config-export'),
     url(
         r'^add/$',
-        staff_member_required(views.pricing_add),
+        views.pricing_add,
         name='lingo-manager-pricing-add',
     ),
     url(
         r'^(?P<pk>\d+)/$',
-        staff_member_required(views.pricing_detail),
+        views.pricing_detail,
         name='lingo-manager-pricing-detail',
     ),
     url(
         r'^(?P<pk>\d+)/edit/$',
-        staff_member_required(views.pricing_edit),
+        views.pricing_edit,
         name='lingo-manager-pricing-edit',
     ),
     url(
         r'^(?P<pk>\d+)/delete/$',
-        staff_member_required(views.pricing_delete),
+        views.pricing_delete,
         name='lingo-manager-pricing-delete',
     ),
     url(
         r'^(?P<pk>\d+)/duplicate/$',
-        staff_member_required(views.pricing_duplicate),
+        views.pricing_duplicate,
         name='lingo-manager-pricing-duplicate',
     ),
     url(
         r'^(?P<pk>\d+)/export/$',
-        staff_member_required(views.pricing_export),
+        views.pricing_export,
         name='lingo-manager-pricing-export',
     ),
     url(
         r'^(?P<pk>\d+)/variable/$',
-        staff_member_required(views.pricing_variable_edit),
+        views.pricing_variable_edit,
         name='lingo-manager-pricing-variable-edit',
     ),
     url(
         r'^(?P<pk>\d+)/category/add/$',
-        staff_member_required(views.pricing_criteria_category_add),
+        views.pricing_criteria_category_add,
         name='lingo-manager-pricing-criteria-category-add',
     ),
     url(
         r'^(?P<pk>\d+)/category/(?P<category_pk>\d+)/edit/$',
-        staff_member_required(views.pricing_criteria_category_edit),
+        views.pricing_criteria_category_edit,
         name='lingo-manager-pricing-criteria-category-edit',
     ),
     url(
         r'^(?P<pk>\d+)/category/(?P<category_pk>\d+)/delete/$',
-        staff_member_required(views.pricing_criteria_category_delete),
+        views.pricing_criteria_category_delete,
         name='lingo-manager-pricing-criteria-category-delete',
     ),
     url(
         r'^(?P<pk>\d+)/order/$',
-        staff_member_required(views.pricing_criteria_category_order),
+        views.pricing_criteria_category_order,
         name='lingo-manager-pricing-criteria-category-order',
     ),
     url(
         r'^criterias/$',
-        staff_member_required(views.criteria_list),
+        views.criteria_list,
         name='lingo-manager-pricing-criteria-list',
     ),
     url(
         r'^criteria/category/add/$',
-        staff_member_required(views.criteria_category_add),
+        views.criteria_category_add,
         name='lingo-manager-pricing-criteria-category-add',
     ),
     url(
         r'^criteria/category/(?P<pk>\d+)/edit/$',
-        staff_member_required(views.criteria_category_edit),
+        views.criteria_category_edit,
         name='lingo-manager-pricing-criteria-category-edit',
     ),
     url(
         r'^criteria/category/(?P<pk>\d+)/delete/$',
-        staff_member_required(views.criteria_category_delete),
+        views.criteria_category_delete,
         name='lingo-manager-pricing-criteria-category-delete',
     ),
     url(
         r'^criteria/category/(?P<pk>\d+)/export/$',
-        staff_member_required(views.criteria_category_export),
+        views.criteria_category_export,
         name='lingo-manager-pricing-criteria-category-export',
     ),
     url(
         r'^criteria/category/(?P<pk>\d+)/order/$',
-        staff_member_required(views.criteria_order),
+        views.criteria_order,
         name='lingo-manager-pricing-criteria-order',
     ),
     url(
         r'^criteria/category/(?P<category_pk>\d+)/add/$',
-        staff_member_required(views.criteria_add),
+        views.criteria_add,
         name='lingo-manager-pricing-criteria-add',
     ),
     url(
         r'^criteria/category/(?P<category_pk>\d+)/(?P<pk>\d+)/edit/$',
-        staff_member_required(views.criteria_edit),
+        views.criteria_edit,
         name='lingo-manager-pricing-criteria-edit',
     ),
     url(
         r'^criteria/category/(?P<category_pk>\d+)/(?P<pk>\d+)/delete/$',
-        staff_member_required(views.criteria_delete),
+        views.criteria_delete,
         name='lingo-manager-pricing-criteria-delete',
     ),
     url(
         r'^agendas/sync/$',
-        staff_member_required(views.agenda_sync),
+        views.agenda_sync,
         name='lingo-manager-agenda-sync',
     ),
     url(
         r'^agendas/$',
-        staff_member_required(views.agenda_list),
+        views.agenda_list,
         name='lingo-manager-agenda-list',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/$',
-        staff_member_required(views.agenda_detail),
+        views.agenda_detail,
         name='lingo-manager-agenda-detail',
     ),
     url(
         r'^agenda/((?P<slug>[-_a-zA-Z0-9]+))/$',
-        staff_member_required(views.agenda_detail_redirect),
+        views.agenda_detail_redirect,
         name='lingo-manager-agenda-detail-redirect',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/export/$',
-        staff_member_required(views.agenda_export),
+        views.agenda_export,
         name='lingo-manager-agenda-export',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/check-options/$',
-        staff_member_required(views.agenda_booking_check_settings),
+        views.agenda_booking_check_settings,
         name='lingo-manager-agenda-booking-check-settings',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/pricing/add/$',
-        staff_member_required(views.agenda_pricing_add),
+        views.agenda_pricing_add,
         name='lingo-manager-agenda-pricing-add',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/pricing/(?P<pricing_pk>\d+)/$',
-        staff_member_required(views.agenda_pricing_detail),
+        views.agenda_pricing_detail,
         name='lingo-manager-agenda-pricing-detail',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/pricing/(?P<pricing_pk>\d+)/edit/$',
-        staff_member_required(views.agenda_pricing_edit),
+        views.agenda_pricing_edit,
         name='lingo-manager-agenda-pricing-edit',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/pricing/(?P<pricing_pk>\d+)/delete/$',
-        staff_member_required(views.agenda_pricing_delete),
+        views.agenda_pricing_delete,
         name='lingo-manager-agenda-pricing-delete',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/pricing/(?P<pricing_pk>\d+)/matrix/edit/$',
-        staff_member_required(views.agenda_pricing_matrix_edit),
+        views.agenda_pricing_matrix_edit,
         name='lingo-manager-agenda-pricing-matrix-edit',
     ),
     url(
         r'^agenda/(?P<pk>\d+)/pricing/(?P<pricing_pk>\d+)/matrix/(?P<slug>[-_a-zA-Z0-9]+)/edit/$',
-        staff_member_required(views.agenda_pricing_matrix_edit),
+        views.agenda_pricing_matrix_edit,
         name='lingo-manager-agenda-pricing-matrix-slug-edit',
     ),
-    url(
-        r'^check-types/$', staff_member_required(views.check_type_list), name='lingo-manager-check-type-list'
-    ),
+    url(r'^check-types/$', views.check_type_list, name='lingo-manager-check-type-list'),
     url(
         r'^check-type/group/add/$',
-        staff_member_required(views.check_type_group_add),
+        views.check_type_group_add,
         name='lingo-manager-check-type-group-add',
     ),
     url(
         r'^check-type/group/(?P<pk>\d+)/edit/$',
-        staff_member_required(views.check_type_group_edit),
+        views.check_type_group_edit,
         name='lingo-manager-check-type-group-edit',
     ),
     url(
         r'^check-type/group/(?P<pk>\d+)/delete/$',
-        staff_member_required(views.check_type_group_delete),
+        views.check_type_group_delete,
         name='lingo-manager-check-type-group-delete',
     ),
     url(
         r'^check-type/group/(?P<pk>\d+)/export/$',
-        staff_member_required(views.check_type_group_export),
+        views.check_type_group_export,
         name='lingo-manager-check-type-group-export',
     ),
     url(
         r'^check-type/group/(?P<group_pk>\d+)/add/$',
-        staff_member_required(views.check_type_add),
+        views.check_type_add,
         name='lingo-manager-check-type-add',
     ),
     url(
         r'^check-type/group/(?P<group_pk>\d+)/(?P<pk>\d+)/edit/$',
-        staff_member_required(views.check_type_edit),
+        views.check_type_edit,
         name='lingo-manager-check-type-edit',
     ),
     url(
         r'^check-type/group/(?P<group_pk>\d+)/(?P<pk>\d+)/delete/$',
-        staff_member_required(views.check_type_delete),
+        views.check_type_delete,
         name='lingo-manager-check-type-delete',
     ),
 ]
-- 
2.35.1

