From 1951ab467d6e2892de0cf5543fc1aabfccdd3287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Kervella?= Date: Wed, 20 Jun 2018 11:44:43 +0000 Subject: [PATCH] Remove plural from urls --- api/tests.py | 168 +++++++++++++++++++++++++-------------------------- api/urls.py | 56 ++++++++--------- 2 files changed, 112 insertions(+), 112 deletions(-) diff --git a/api/tests.py b/api/tests.py index 89ab7bdd..5c4122bd 100644 --- a/api/tests.py +++ b/api/tests.py @@ -51,56 +51,56 @@ class APIEndpointsTestCase(APITestCase): ] auth_no_perm_endpoints = [] auth_perm_endpoints = [ - '/api/cotisations/articles/', -# '/api/cotisations/articles//', - '/api/cotisations/banques/', -# '/api/cotisations/banques//', - '/api/cotisations/cotisations/', -# '/api/cotisations/cotisations//', - '/api/cotisations/factures/', -# '/api/cotisations/factures//', - '/api/cotisations/paiements/', -# '/api/cotisations/paiements//', - '/api/cotisations/ventes/', -# '/api/cotisations/ventes//', - '/api/machines/domains/', -# '/api/machines/domains//', - '/api/machines/extensions/', -# '/api/machines/extensions//', - '/api/machines/interfaces/', -# '/api/machines/interfaces//', - '/api/machines/iplists/', -# '/api/machines/iplists//', - '/api/machines/iptypes/', -# '/api/machines/iptypes//', - '/api/machines/ipv6lists/', -# '/api/machines/ipv6lists//', - '/api/machines/machines/', -# '/api/machines/machines//', - '/api/machines/machinetypes/', -# '/api/machines/machinetypes//', + '/api/cotisations/article/', +# '/api/cotisations/article//', + '/api/cotisations/banque/', +# '/api/cotisations/banque//', + '/api/cotisations/cotisation/', +# '/api/cotisations/cotisation//', + '/api/cotisations/facture/', +# '/api/cotisations/facture//', + '/api/cotisations/paiement/', +# '/api/cotisations/paiement//', + '/api/cotisations/vente/', +# '/api/cotisations/vente//', + '/api/machines/domain/', +# '/api/machines/domain//', + '/api/machines/extension/', +# '/api/machines/extension//', + '/api/machines/interface/', +# '/api/machines/interface//', + '/api/machines/iplist/', +# '/api/machines/iplist//', + '/api/machines/iptype/', +# '/api/machines/iptype//', + '/api/machines/ipv6list/', +# '/api/machines/ipv6list//', + '/api/machines/machine/', +# '/api/machines/machine//', + '/api/machines/machinetype/', +# '/api/machines/machinetype//', '/api/machines/mx/', # '/api/machines/mx//', '/api/machines/nas/', # '/api/machines/nas//', '/api/machines/ns/', # '/api/machines/ns//', - '/api/machines/ouvertureportlists/', -# '/api/machines/ouvertureportlists//', - '/api/machines/ouvertureports/', -# '/api/machines/ouvertureports//', - '/api/machines/servicelinks/', -# '/api/machines/servicelinks//', - '/api/machines/services/', -# '/api/machines/services//', + '/api/machines/ouvertureportlist/', +# '/api/machines/ouvertureportlist//', + '/api/machines/ouvertureport/', +# '/api/machines/ouvertureport//', + '/api/machines/servicelink/', +# '/api/machines/servicelink//', + '/api/machines/service/', +# '/api/machines/service//', '/api/machines/soa/', # '/api/machines/soa//', '/api/machines/srv/', # '/api/machines/srv//', '/api/machines/txt/', # '/api/machines/txt//', - '/api/machines/vlans/', -# '/api/machines/vlans//', + '/api/machines/vlan/', +# '/api/machines/vlan//', '/api/preferences/optionaluser/', '/api/preferences/optionalmachine/', '/api/preferences/optionaltopologie/', @@ -128,24 +128,24 @@ class APIEndpointsTestCase(APITestCase): # '/api/topologie/switchbay//', '/api/topologie/switchport/', # '/api/topologie/switchport//', - '/api/users/adherents/', -# '/api/users/adherents//', - '/api/users/bans/', -# '/api/users/bans//', - '/api/users/clubs/', -# '/api/users/clubs//', - '/api/users/listrights/', -# '/api/users/listrights//', - '/api/users/schools/', -# '/api/users/schools//', - '/api/users/serviceusers/', -# '/api/users/serviceusers//', - '/api/users/shells/', -# '/api/users/shells//', - '/api/users/users/', -# '/api/users/users//', - '/api/users/whitelists/', -# '/api/users/whitelists//', + '/api/users/adherent/', +# '/api/users/adherent//', + '/api/users/ban/', +# '/api/users/ban//', + '/api/users/club/', +# '/api/users/club//', + '/api/users/listright/', +# '/api/users/listright//', + '/api/users/school/', +# '/api/users/school//', + '/api/users/serviceuser/', +# '/api/users/serviceuser//', + '/api/users/shell/', +# '/api/users/shell//', + '/api/users/user/', +# '/api/users/user//', + '/api/users/whitelist/', +# '/api/users/whitelist//', '/api/dns/zones/', '/api/dhcp/hostmacip/', '/api/mailing/standard', @@ -331,31 +331,31 @@ class APIPaginationTestCase(APITestCase): """ endpoints = [ - '/api/cotisations/articles/', - '/api/cotisations/banques/', - '/api/cotisations/cotisations/', - '/api/cotisations/factures/', - '/api/cotisations/paiements/', - '/api/cotisations/ventes/', - '/api/machines/domains/', - '/api/machines/extensions/', - '/api/machines/interfaces/', - '/api/machines/iplists/', - '/api/machines/iptypes/', - '/api/machines/ipv6lists/', - '/api/machines/machines/', - '/api/machines/machinetypes/', + '/api/cotisations/article/', + '/api/cotisations/banque/', + '/api/cotisations/cotisation/', + '/api/cotisations/facture/', + '/api/cotisations/paiement/', + '/api/cotisations/vente/', + '/api/machines/domain/', + '/api/machines/extension/', + '/api/machines/interface/', + '/api/machines/iplist/', + '/api/machines/iptype/', + '/api/machines/ipv6list/', + '/api/machines/machine/', + '/api/machines/machinetype/', '/api/machines/mx/', '/api/machines/nas/', '/api/machines/ns/', - '/api/machines/ouvertureportlists/', - '/api/machines/ouvertureports/', - '/api/machines/servicelinks/', - '/api/machines/services/', + '/api/machines/ouvertureportlist/', + '/api/machines/ouvertureport/', + '/api/machines/servicelink/', + '/api/machines/service/', '/api/machines/soa/', '/api/machines/srv/', '/api/machines/txt/', - '/api/machines/vlans/', + '/api/machines/vlan/', '/api/preferences/service/', '/api/topologie/acesspoint/', '/api/topologie/building/', @@ -366,15 +366,15 @@ class APIPaginationTestCase(APITestCase): '/api/topologie/switch/', '/api/topologie/switchbay/', '/api/topologie/switchport/', - '/api/users/adherents/', - '/api/users/bans/', - '/api/users/clubs/', - '/api/users/listrights/', - '/api/users/schools/', - '/api/users/serviceusers/', - '/api/users/shells/', - '/api/users/users/', - '/api/users/whitelists/', + '/api/users/adherent/', + '/api/users/ban/', + '/api/users/club/', + '/api/users/listright/', + '/api/users/school/', + '/api/users/serviceuser/', + '/api/users/shell/', + '/api/users/user/', + '/api/users/whitelist/', '/api/dns/zones/', '/api/dhcp/hostmacip/', '/api/mailing/standard', diff --git a/api/urls.py b/api/urls.py index c835429f..9d6b5f5e 100644 --- a/api/urls.py +++ b/api/urls.py @@ -34,32 +34,32 @@ from .routers import AllViewsRouter router = AllViewsRouter() # COTISATIONS -router.register_viewset(r'cotisations/factures', views.FactureViewSet) -router.register_viewset(r'cotisations/ventes', views.VenteViewSet) -router.register_viewset(r'cotisations/articles', views.ArticleViewSet) -router.register_viewset(r'cotisations/banques', views.BanqueViewSet) -router.register_viewset(r'cotisations/paiements', views.PaiementViewSet) -router.register_viewset(r'cotisations/cotisations', views.CotisationViewSet) +router.register_viewset(r'cotisations/facture', views.FactureViewSet) +router.register_viewset(r'cotisations/vente', views.VenteViewSet) +router.register_viewset(r'cotisations/article', views.ArticleViewSet) +router.register_viewset(r'cotisations/banque', views.BanqueViewSet) +router.register_viewset(r'cotisations/paiement', views.PaiementViewSet) +router.register_viewset(r'cotisations/cotisation', views.CotisationViewSet) # MACHINES -router.register_viewset(r'machines/machines', views.MachineViewSet) -router.register_viewset(r'machines/machinetypes', views.MachineTypeViewSet) -router.register_viewset(r'machines/iptypes', views.IpTypeViewSet) -router.register_viewset(r'machines/vlans', views.VlanViewSet) +router.register_viewset(r'machines/machine', views.MachineViewSet) +router.register_viewset(r'machines/machinetype', views.MachineTypeViewSet) +router.register_viewset(r'machines/iptype', views.IpTypeViewSet) +router.register_viewset(r'machines/vlan', views.VlanViewSet) router.register_viewset(r'machines/nas', views.NasViewSet) router.register_viewset(r'machines/soa', views.SOAViewSet) -router.register_viewset(r'machines/extensions', views.ExtensionViewSet) +router.register_viewset(r'machines/extension', views.ExtensionViewSet) router.register_viewset(r'machines/mx', views.MxViewSet) router.register_viewset(r'machines/ns', views.NsViewSet) router.register_viewset(r'machines/txt', views.TxtViewSet) router.register_viewset(r'machines/srv', views.SrvViewSet) -router.register_viewset(r'machines/interfaces', views.InterfaceViewSet) -router.register_viewset(r'machines/ipv6lists', views.Ipv6ListViewSet) -router.register_viewset(r'machines/domains', views.DomainViewSet) -router.register_viewset(r'machines/iplists', views.IpListViewSet) -router.register_viewset(r'machines/services', views.ServiceViewSet) -router.register_viewset(r'machines/servicelinks', views.ServiceLinkViewSet, base_name='servicelink') -router.register_viewset(r'machines/ouvertureportlists', views.OuverturePortListViewSet) -router.register_viewset(r'machines/ouvertureports', views.OuverturePortViewSet) +router.register_viewset(r'machines/interface', views.InterfaceViewSet) +router.register_viewset(r'machines/ipv6list', views.Ipv6ListViewSet) +router.register_viewset(r'machines/domain', views.DomainViewSet) +router.register_viewset(r'machines/iplist', views.IpListViewSet) +router.register_viewset(r'machines/service', views.ServiceViewSet) +router.register_viewset(r'machines/servicelink', views.ServiceLinkViewSet, base_name='servicelink') +router.register_viewset(r'machines/ouvertureportlist', views.OuverturePortListViewSet) +router.register_viewset(r'machines/ouvertureport', views.OuverturePortViewSet) # PREFERENCES router.register_view(r'preferences/optionaluser', views.OptionalUserView), router.register_view(r'preferences/optionalmachine', views.OptionalMachineView), @@ -80,15 +80,15 @@ router.register_viewset(r'topologie/building', views.BuildingViewSet) router.register_viewset(r'topologie/switchport', views.SwitchPortViewSet, base_name='switchport') router.register_viewset(r'topologie/room', views.RoomViewSet) # USERS -router.register_viewset(r'users/users', views.UserViewSet) -router.register_viewset(r'users/clubs', views.ClubViewSet) -router.register_viewset(r'users/adherents', views.AdherentViewSet) -router.register_viewset(r'users/serviceusers', views.ServiceUserViewSet) -router.register_viewset(r'users/schools', views.SchoolViewSet) -router.register_viewset(r'users/listrights', views.ListRightViewSet) -router.register_viewset(r'users/shells', views.ShellViewSet, base_name='shell') -router.register_viewset(r'users/bans', views.BanViewSet) -router.register_viewset(r'users/whitelists', views.WhitelistViewSet) +router.register_viewset(r'users/user', views.UserViewSet) +router.register_viewset(r'users/club', views.ClubViewSet) +router.register_viewset(r'users/adherent', views.AdherentViewSet) +router.register_viewset(r'users/serviceuser', views.ServiceUserViewSet) +router.register_viewset(r'users/school', views.SchoolViewSet) +router.register_viewset(r'users/listright', views.ListRightViewSet) +router.register_viewset(r'users/shell', views.ShellViewSet, base_name='shell') +router.register_viewset(r'users/ban', views.BanViewSet) +router.register_viewset(r'users/whitelist', views.WhitelistViewSet) # SERVICE REGEN router.register_viewset(r'services/regen', views.ServiceRegenViewSet, base_name='serviceregen') # DHCP