From e5b0f24b71d096ab942cc5339cc2153d569fb7a0 Mon Sep 17 00:00:00 2001 From: Vlad0n20 Date: Fri, 10 Jan 2025 17:55:30 +0200 Subject: [PATCH] Update regex for versioned guids --- api/chronos/urls.py | 4 ++-- api/preprints/urls.py | 35 ++++++++++++++++++----------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/api/chronos/urls.py b/api/chronos/urls.py index b5fb4c939071..55efe089bb74 100644 --- a/api/chronos/urls.py +++ b/api/chronos/urls.py @@ -7,6 +7,6 @@ urlpatterns = [ re_path(r'^journals/$', views.ChronosJournalList.as_view(), name=views.ChronosJournalList.view_name), re_path(r'^journals/(?P[-0-9A-Za-z]+)/$', views.ChronosJournalDetail.as_view(), name=views.ChronosJournalDetail.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/submissions/$', views.ChronosSubmissionList.as_view(), name=views.ChronosSubmissionList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/submissions/(?P[-0-9A-Za-z]+)/$', views.ChronosSubmissionDetail.as_view(), name=views.ChronosSubmissionDetail.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/submissions/$', views.ChronosSubmissionList.as_view(), name=views.ChronosSubmissionList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/submissions/(?P[-0-9A-Za-z]+)/$', views.ChronosSubmissionDetail.as_view(), name=views.ChronosSubmissionDetail.view_name), ] diff --git a/api/preprints/urls.py b/api/preprints/urls.py index ee3d6a356ebd..440143fb2893 100644 --- a/api/preprints/urls.py +++ b/api/preprints/urls.py @@ -5,22 +5,23 @@ app_name = 'osf' urlpatterns = [ + # ^(?P[A-Za-z0-9_]\d+)/$ re_path(r'^$', views.PreprintList.as_view(), name=views.PreprintList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/$', views.PreprintDetail.as_view(), name=views.PreprintDetail.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/bibliographic_contributors/$', views.PreprintBibliographicContributorsList.as_view(), name=views.PreprintBibliographicContributorsList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/citation/$', views.PreprintCitationDetail.as_view(), name=views.PreprintCitationDetail.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/citation/(?P[-\w]+)/$', views.PreprintCitationStyleDetail.as_view(), name=views.PreprintCitationStyleDetail.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/contributors/$', views.PreprintContributorsList.as_view(), name=views.PreprintContributorsList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/contributors/(?P\w+)/$', views.PreprintContributorDetail.as_view(), name=views.PreprintContributorDetail.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/files/$', views.PreprintStorageProvidersList.as_view(), name=views.PreprintStorageProvidersList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/files/osfstorage/$', views.PreprintFilesList.as_view(), name=views.PreprintFilesList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/identifiers/$', views.PreprintIdentifierList.as_view(), name=views.PreprintIdentifierList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/institutions/$', views.PreprintInstitutionsList.as_view(), name=views.PreprintInstitutionsList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/relationships/institutions/$', views.PreprintInstitutionsRelationship.as_view(), name=views.PreprintInstitutionsRelationship.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/relationships/node/$', views.PreprintNodeRelationship.as_view(), name=views.PreprintNodeRelationship.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/relationships/subjects/$', views.PreprintSubjectsRelationship.as_view(), name=views.PreprintSubjectsRelationship.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/review_actions/$', views.PreprintActionList.as_view(), name=views.PreprintActionList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/requests/$', views.PreprintRequestListCreate.as_view(), name=views.PreprintRequestListCreate.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/subjects/$', views.PreprintSubjectsList.as_view(), name=views.PreprintSubjectsList.view_name), - re_path(r'^(?P[A-Za-z0-9_]+)/versions/$', views.PreprintVersionsList.as_view(), name=views.PreprintVersionsList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/$', views.PreprintDetail.as_view(), name=views.PreprintDetail.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/bibliographic_contributors/$', views.PreprintBibliographicContributorsList.as_view(), name=views.PreprintBibliographicContributorsList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/citation/$', views.PreprintCitationDetail.as_view(), name=views.PreprintCitationDetail.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/citation/(?P[-\w]+)/$', views.PreprintCitationStyleDetail.as_view(), name=views.PreprintCitationStyleDetail.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/contributors/$', views.PreprintContributorsList.as_view(), name=views.PreprintContributorsList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/contributors/(?P\w+)/$', views.PreprintContributorDetail.as_view(), name=views.PreprintContributorDetail.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/files/$', views.PreprintStorageProvidersList.as_view(), name=views.PreprintStorageProvidersList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/files/osfstorage/$', views.PreprintFilesList.as_view(), name=views.PreprintFilesList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/identifiers/$', views.PreprintIdentifierList.as_view(), name=views.PreprintIdentifierList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/institutions/$', views.PreprintInstitutionsList.as_view(), name=views.PreprintInstitutionsList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/relationships/institutions/$', views.PreprintInstitutionsRelationship.as_view(), name=views.PreprintInstitutionsRelationship.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/relationships/node/$', views.PreprintNodeRelationship.as_view(), name=views.PreprintNodeRelationship.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/relationships/subjects/$', views.PreprintSubjectsRelationship.as_view(), name=views.PreprintSubjectsRelationship.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/review_actions/$', views.PreprintActionList.as_view(), name=views.PreprintActionList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/requests/$', views.PreprintRequestListCreate.as_view(), name=views.PreprintRequestListCreate.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/subjects/$', views.PreprintSubjectsList.as_view(), name=views.PreprintSubjectsList.view_name), + re_path(r'^(?P[A-Za-z0-9_]+_[Vv]\d+)/versions/$', views.PreprintVersionsList.as_view(), name=views.PreprintVersionsList.view_name), ]