Skip to content

Commit

Permalink
Remove UUID regex from location/urls.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhwaniartefact committed Mar 26, 2024
1 parent 05387d3 commit e945a5b
Showing 1 changed file with 38 additions and 49 deletions.
87 changes: 38 additions & 49 deletions storage_service/locations/urls.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
from django.urls import path
from django.urls import re_path
from locations import views

UUID = r"\w{8}-\w{4}-\w{4}-\w{4}-\w{12}"

app_name = "locations"
urlpatterns = [
# Sorted by alphabetized categories
# Locations
path("locations/", views.location_list, name="location_list"),
re_path(
r"^locations/(?P<location_uuid>" + UUID + ")/$",
path(
"locations/<uuid:location_uuid>",
views.location_detail,
name="location_detail",
),
re_path(
r"^locations/(?P<location_uuid>" + UUID + ")/delete/$",
path(
"locations/<uuid:location_uuid>/delete/",
views.location_delete,
name="location_delete",
),
re_path(
r"^locations/(?P<location_uuid>" + UUID + ")/switch_enabled/$",
path(
"locations/<uuid:location_uuid>/switch_enabled/",
views.location_switch_enabled,
name="location_switch_enabled",
),
Expand All @@ -32,13 +29,13 @@
views.package_delete_request,
name="package_delete_request",
),
re_path(
r"^packages/(?P<uuid>" + UUID + ")/delete/$",
path(
"packages/<uuid:uuid>/delete/",
views.package_delete,
name="package_delete",
),
re_path(
r"^packages/(?P<uuid>" + UUID + ")/update_status/$",
path(
"packages/<uuid:uuid>/update_status/",
views.package_update_status,
name="package_update_status",
),
Expand All @@ -47,65 +44,57 @@
views.aip_recover_request,
name="aip_recover_request",
),
re_path(
r"^packages/(?P<package_uuid>" + UUID + ")/reingest/$",
path(
"packages/<uuid:package_uuid>/reingest/",
views.aip_reingest,
name="aip_reingest",
),
# Fixity check results
re_path(
r"^fixity/(?P<package_uuid>" + UUID + ")/$",
path(
"fixity/<uuid:package_uuid>/",
views.package_fixity,
name="package_fixity",
),
path("fixity_ajax/", views.fixity_logs_ajax, name="fixity_logs_ajax"),
# Pipelines
path("pipelines/", views.pipeline_list, name="pipeline_list"),
path("pipelines/create/", views.pipeline_edit, name="pipeline_create"),
re_path(
r"^pipeline/(?P<uuid>" + UUID + ")/edit/$",
path(
"pipeline/<uuid:uuid>/edit/",
views.pipeline_edit,
name="pipeline_edit",
),
re_path(
r"^pipeline/(?P<uuid>" + UUID + ")/detail/$",
path(
"pipeline/<uuid:uuid>/detail/",
views.pipeline_detail,
name="pipeline_detail",
),
re_path(
r"^pipeline/(?P<uuid>" + UUID + ")/delete/$",
path(
"pipeline/<uuid:uuid>/delete/",
views.pipeline_delete,
name="pipeline_delete",
),
re_path(
r"^pipeline/(?P<uuid>" + UUID + ")/switch_enabled/$",
path(
"pipeline/<uuid:uuid>/switch_enabled/",
views.pipeline_switch_enabled,
name="pipeline_switch_enabled",
),
# Spaces
path("spaces/", views.space_list, name="space_list"),
re_path(
r"^spaces/(?P<uuid>" + UUID + ")/$", views.space_detail, name="space_detail"
),
re_path(
r"^spaces/(?P<uuid>" + UUID + ")/edit/$", views.space_edit, name="space_edit"
),
re_path(
r"^spaces/(?P<uuid>" + UUID + ")/delete/$",
path("spaces/<uuid:uuid>/", views.space_detail, name="space_detail"),
path("spaces/<uuid:uuid>/edit/", views.space_edit, name="space_edit"),
path(
"spaces/<uuid:uuid>/delete/",
views.space_delete,
name="space_delete",
),
re_path(
r"^spaces/(?P<space_uuid>" + UUID + ")/location_create/$",
path(
"spaces/<uuid:space_uuid>/location_create/",
views.location_edit,
name="location_create",
),
re_path(
r"^spaces/(?P<space_uuid>"
+ UUID
+ ")/location/(?P<location_uuid>"
+ UUID
+ ")/edit/$",
path(
"spaces/<uuid:space_uuid>/location/<uuid:location_uuid>/edit/",
views.location_edit,
name="location_edit",
),
Expand All @@ -118,24 +107,24 @@
),
# Callbacks
path("callbacks/", views.callback_list, name="callback_list"),
re_path(
r"^callbacks/(?P<uuid>" + UUID + ")/$",
path(
"callbacks/<uuid:uuid>/",
views.callback_detail,
name="callback_detail",
),
path("callbacks/create/", views.callback_edit, name="callback_create"),
re_path(
r"^callbacks/(?P<uuid>" + UUID + ")/edit/$",
path(
"callbacks/<uuid:uuid>/edit/",
views.callback_edit,
name="callback_edit",
),
re_path(
r"^callbacks/(?P<uuid>" + UUID + ")/delete/$",
path(
"callbacks/<uuid:uuid>/delete/",
views.callback_delete,
name="callback_delete",
),
re_path(
r"^callbacks/(?P<uuid>" + UUID + ")/switch_enabled/$",
path(
"callbacks/<uuid:uuid>/switch_enabled/",
views.callback_switch_enabled,
name="callback_switch_enabled",
),
Expand Down

0 comments on commit e945a5b

Please sign in to comment.