8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-30 08:32:26 +00:00

Remove plural from urls

This commit is contained in:
Maël Kervella 2018-06-20 11:44:43 +00:00
parent 3a129a5d6e
commit 1951ab467d
2 changed files with 112 additions and 112 deletions

View file

@ -51,56 +51,56 @@ class APIEndpointsTestCase(APITestCase):
] ]
auth_no_perm_endpoints = [] auth_no_perm_endpoints = []
auth_perm_endpoints = [ auth_perm_endpoints = [
'/api/cotisations/articles/', '/api/cotisations/article/',
# '/api/cotisations/articles/<pk>/', # '/api/cotisations/article/<pk>/',
'/api/cotisations/banques/', '/api/cotisations/banque/',
# '/api/cotisations/banques/<pk>/', # '/api/cotisations/banque/<pk>/',
'/api/cotisations/cotisations/', '/api/cotisations/cotisation/',
# '/api/cotisations/cotisations/<pk>/', # '/api/cotisations/cotisation/<pk>/',
'/api/cotisations/factures/', '/api/cotisations/facture/',
# '/api/cotisations/factures/<pk>/', # '/api/cotisations/facture/<pk>/',
'/api/cotisations/paiements/', '/api/cotisations/paiement/',
# '/api/cotisations/paiements/<pk>/', # '/api/cotisations/paiement/<pk>/',
'/api/cotisations/ventes/', '/api/cotisations/vente/',
# '/api/cotisations/ventes/<pk>/', # '/api/cotisations/vente/<pk>/',
'/api/machines/domains/', '/api/machines/domain/',
# '/api/machines/domains/<pk>/', # '/api/machines/domain/<pk>/',
'/api/machines/extensions/', '/api/machines/extension/',
# '/api/machines/extensions/<pk>/', # '/api/machines/extension/<pk>/',
'/api/machines/interfaces/', '/api/machines/interface/',
# '/api/machines/interfaces/<pk>/', # '/api/machines/interface/<pk>/',
'/api/machines/iplists/', '/api/machines/iplist/',
# '/api/machines/iplists/<pk>/', # '/api/machines/iplist/<pk>/',
'/api/machines/iptypes/', '/api/machines/iptype/',
# '/api/machines/iptypes/<pk>/', # '/api/machines/iptype/<pk>/',
'/api/machines/ipv6lists/', '/api/machines/ipv6list/',
# '/api/machines/ipv6lists/<pk>/', # '/api/machines/ipv6list/<pk>/',
'/api/machines/machines/', '/api/machines/machine/',
# '/api/machines/machines/<pk>/', # '/api/machines/machine/<pk>/',
'/api/machines/machinetypes/', '/api/machines/machinetype/',
# '/api/machines/machinetypes/<pk>/', # '/api/machines/machinetype/<pk>/',
'/api/machines/mx/', '/api/machines/mx/',
# '/api/machines/mx/<pk>/', # '/api/machines/mx/<pk>/',
'/api/machines/nas/', '/api/machines/nas/',
# '/api/machines/nas/<pk>/', # '/api/machines/nas/<pk>/',
'/api/machines/ns/', '/api/machines/ns/',
# '/api/machines/ns/<pk>/', # '/api/machines/ns/<pk>/',
'/api/machines/ouvertureportlists/', '/api/machines/ouvertureportlist/',
# '/api/machines/ouvertureportlists/<pk>/', # '/api/machines/ouvertureportlist/<pk>/',
'/api/machines/ouvertureports/', '/api/machines/ouvertureport/',
# '/api/machines/ouvertureports/<pk>/', # '/api/machines/ouvertureport/<pk>/',
'/api/machines/servicelinks/', '/api/machines/servicelink/',
# '/api/machines/servicelinks/<pk>/', # '/api/machines/servicelink/<pk>/',
'/api/machines/services/', '/api/machines/service/',
# '/api/machines/services/<pk>/', # '/api/machines/service/<pk>/',
'/api/machines/soa/', '/api/machines/soa/',
# '/api/machines/soa/<pk>/', # '/api/machines/soa/<pk>/',
'/api/machines/srv/', '/api/machines/srv/',
# '/api/machines/srv/<pk>/', # '/api/machines/srv/<pk>/',
'/api/machines/txt/', '/api/machines/txt/',
# '/api/machines/txt/<pk>/', # '/api/machines/txt/<pk>/',
'/api/machines/vlans/', '/api/machines/vlan/',
# '/api/machines/vlans/<pk>/', # '/api/machines/vlan/<pk>/',
'/api/preferences/optionaluser/', '/api/preferences/optionaluser/',
'/api/preferences/optionalmachine/', '/api/preferences/optionalmachine/',
'/api/preferences/optionaltopologie/', '/api/preferences/optionaltopologie/',
@ -128,24 +128,24 @@ class APIEndpointsTestCase(APITestCase):
# '/api/topologie/switchbay/<pk>/', # '/api/topologie/switchbay/<pk>/',
'/api/topologie/switchport/', '/api/topologie/switchport/',
# '/api/topologie/switchport/<pk>/', # '/api/topologie/switchport/<pk>/',
'/api/users/adherents/', '/api/users/adherent/',
# '/api/users/adherents/<pk>/', # '/api/users/adherent/<pk>/',
'/api/users/bans/', '/api/users/ban/',
# '/api/users/bans/<pk>/', # '/api/users/ban/<pk>/',
'/api/users/clubs/', '/api/users/club/',
# '/api/users/clubs/<pk>/', # '/api/users/club/<pk>/',
'/api/users/listrights/', '/api/users/listright/',
# '/api/users/listrights/<pk>/', # '/api/users/listright/<pk>/',
'/api/users/schools/', '/api/users/school/',
# '/api/users/schools/<pk>/', # '/api/users/school/<pk>/',
'/api/users/serviceusers/', '/api/users/serviceuser/',
# '/api/users/serviceusers/<pk>/', # '/api/users/serviceuser/<pk>/',
'/api/users/shells/', '/api/users/shell/',
# '/api/users/shells/<pk>/', # '/api/users/shell/<pk>/',
'/api/users/users/', '/api/users/user/',
# '/api/users/users/<pk>/', # '/api/users/user/<pk>/',
'/api/users/whitelists/', '/api/users/whitelist/',
# '/api/users/whitelists/<pk>/', # '/api/users/whitelist/<pk>/',
'/api/dns/zones/', '/api/dns/zones/',
'/api/dhcp/hostmacip/', '/api/dhcp/hostmacip/',
'/api/mailing/standard', '/api/mailing/standard',
@ -331,31 +331,31 @@ class APIPaginationTestCase(APITestCase):
""" """
endpoints = [ endpoints = [
'/api/cotisations/articles/', '/api/cotisations/article/',
'/api/cotisations/banques/', '/api/cotisations/banque/',
'/api/cotisations/cotisations/', '/api/cotisations/cotisation/',
'/api/cotisations/factures/', '/api/cotisations/facture/',
'/api/cotisations/paiements/', '/api/cotisations/paiement/',
'/api/cotisations/ventes/', '/api/cotisations/vente/',
'/api/machines/domains/', '/api/machines/domain/',
'/api/machines/extensions/', '/api/machines/extension/',
'/api/machines/interfaces/', '/api/machines/interface/',
'/api/machines/iplists/', '/api/machines/iplist/',
'/api/machines/iptypes/', '/api/machines/iptype/',
'/api/machines/ipv6lists/', '/api/machines/ipv6list/',
'/api/machines/machines/', '/api/machines/machine/',
'/api/machines/machinetypes/', '/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/ouvertureportlist/',
'/api/machines/ouvertureports/', '/api/machines/ouvertureport/',
'/api/machines/servicelinks/', '/api/machines/servicelink/',
'/api/machines/services/', '/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/vlan/',
'/api/preferences/service/', '/api/preferences/service/',
'/api/topologie/acesspoint/', '/api/topologie/acesspoint/',
'/api/topologie/building/', '/api/topologie/building/',
@ -366,15 +366,15 @@ class APIPaginationTestCase(APITestCase):
'/api/topologie/switch/', '/api/topologie/switch/',
'/api/topologie/switchbay/', '/api/topologie/switchbay/',
'/api/topologie/switchport/', '/api/topologie/switchport/',
'/api/users/adherents/', '/api/users/adherent/',
'/api/users/bans/', '/api/users/ban/',
'/api/users/clubs/', '/api/users/club/',
'/api/users/listrights/', '/api/users/listright/',
'/api/users/schools/', '/api/users/school/',
'/api/users/serviceusers/', '/api/users/serviceuser/',
'/api/users/shells/', '/api/users/shell/',
'/api/users/users/', '/api/users/user/',
'/api/users/whitelists/', '/api/users/whitelist/',
'/api/dns/zones/', '/api/dns/zones/',
'/api/dhcp/hostmacip/', '/api/dhcp/hostmacip/',
'/api/mailing/standard', '/api/mailing/standard',

View file

@ -34,32 +34,32 @@ from .routers import AllViewsRouter
router = AllViewsRouter() router = AllViewsRouter()
# COTISATIONS # COTISATIONS
router.register_viewset(r'cotisations/factures', views.FactureViewSet) router.register_viewset(r'cotisations/facture', views.FactureViewSet)
router.register_viewset(r'cotisations/ventes', views.VenteViewSet) router.register_viewset(r'cotisations/vente', views.VenteViewSet)
router.register_viewset(r'cotisations/articles', views.ArticleViewSet) router.register_viewset(r'cotisations/article', views.ArticleViewSet)
router.register_viewset(r'cotisations/banques', views.BanqueViewSet) router.register_viewset(r'cotisations/banque', views.BanqueViewSet)
router.register_viewset(r'cotisations/paiements', views.PaiementViewSet) router.register_viewset(r'cotisations/paiement', views.PaiementViewSet)
router.register_viewset(r'cotisations/cotisations', views.CotisationViewSet) router.register_viewset(r'cotisations/cotisation', views.CotisationViewSet)
# MACHINES # MACHINES
router.register_viewset(r'machines/machines', views.MachineViewSet) router.register_viewset(r'machines/machine', views.MachineViewSet)
router.register_viewset(r'machines/machinetypes', views.MachineTypeViewSet) router.register_viewset(r'machines/machinetype', views.MachineTypeViewSet)
router.register_viewset(r'machines/iptypes', views.IpTypeViewSet) router.register_viewset(r'machines/iptype', views.IpTypeViewSet)
router.register_viewset(r'machines/vlans', views.VlanViewSet) router.register_viewset(r'machines/vlan', views.VlanViewSet)
router.register_viewset(r'machines/nas', views.NasViewSet) router.register_viewset(r'machines/nas', views.NasViewSet)
router.register_viewset(r'machines/soa', views.SOAViewSet) 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/mx', views.MxViewSet)
router.register_viewset(r'machines/ns', views.NsViewSet) router.register_viewset(r'machines/ns', views.NsViewSet)
router.register_viewset(r'machines/txt', views.TxtViewSet) router.register_viewset(r'machines/txt', views.TxtViewSet)
router.register_viewset(r'machines/srv', views.SrvViewSet) router.register_viewset(r'machines/srv', views.SrvViewSet)
router.register_viewset(r'machines/interfaces', views.InterfaceViewSet) router.register_viewset(r'machines/interface', views.InterfaceViewSet)
router.register_viewset(r'machines/ipv6lists', views.Ipv6ListViewSet) router.register_viewset(r'machines/ipv6list', views.Ipv6ListViewSet)
router.register_viewset(r'machines/domains', views.DomainViewSet) router.register_viewset(r'machines/domain', views.DomainViewSet)
router.register_viewset(r'machines/iplists', views.IpListViewSet) router.register_viewset(r'machines/iplist', views.IpListViewSet)
router.register_viewset(r'machines/services', views.ServiceViewSet) router.register_viewset(r'machines/service', views.ServiceViewSet)
router.register_viewset(r'machines/servicelinks', views.ServiceLinkViewSet, base_name='servicelink') router.register_viewset(r'machines/servicelink', views.ServiceLinkViewSet, base_name='servicelink')
router.register_viewset(r'machines/ouvertureportlists', views.OuverturePortListViewSet) router.register_viewset(r'machines/ouvertureportlist', views.OuverturePortListViewSet)
router.register_viewset(r'machines/ouvertureports', views.OuverturePortViewSet) router.register_viewset(r'machines/ouvertureport', views.OuverturePortViewSet)
# PREFERENCES # PREFERENCES
router.register_view(r'preferences/optionaluser', views.OptionalUserView), router.register_view(r'preferences/optionaluser', views.OptionalUserView),
router.register_view(r'preferences/optionalmachine', views.OptionalMachineView), 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/switchport', views.SwitchPortViewSet, base_name='switchport')
router.register_viewset(r'topologie/room', views.RoomViewSet) router.register_viewset(r'topologie/room', views.RoomViewSet)
# USERS # USERS
router.register_viewset(r'users/users', views.UserViewSet) router.register_viewset(r'users/user', views.UserViewSet)
router.register_viewset(r'users/clubs', views.ClubViewSet) router.register_viewset(r'users/club', views.ClubViewSet)
router.register_viewset(r'users/adherents', views.AdherentViewSet) router.register_viewset(r'users/adherent', views.AdherentViewSet)
router.register_viewset(r'users/serviceusers', views.ServiceUserViewSet) router.register_viewset(r'users/serviceuser', views.ServiceUserViewSet)
router.register_viewset(r'users/schools', views.SchoolViewSet) router.register_viewset(r'users/school', views.SchoolViewSet)
router.register_viewset(r'users/listrights', views.ListRightViewSet) router.register_viewset(r'users/listright', views.ListRightViewSet)
router.register_viewset(r'users/shells', views.ShellViewSet, base_name='shell') router.register_viewset(r'users/shell', views.ShellViewSet, base_name='shell')
router.register_viewset(r'users/bans', views.BanViewSet) router.register_viewset(r'users/ban', views.BanViewSet)
router.register_viewset(r'users/whitelists', views.WhitelistViewSet) router.register_viewset(r'users/whitelist', views.WhitelistViewSet)
# SERVICE REGEN # SERVICE REGEN
router.register_viewset(r'services/regen', views.ServiceRegenViewSet, base_name='serviceregen') router.register_viewset(r'services/regen', views.ServiceRegenViewSet, base_name='serviceregen')
# DHCP # DHCP