diff --git a/admin/preprints/urls.py b/admin/preprints/urls.py index 4cb30c1b787c..de4a0bea6962 100644 --- a/admin/preprints/urls.py +++ b/admin/preprints/urls.py @@ -9,24 +9,25 @@ re_path(r'^known_spam$', views.PreprintKnownSpamList.as_view(), name='known-spam'), re_path(r'^known_ham$', views.PreprintKnownHamList.as_view(), name='known-ham'), re_path(r'^withdrawal_requests$', views.PreprintWithdrawalRequestList.as_view(), name='withdrawal-requests'), - re_path(r'^(?P[A-Za-z0-9_]+)/$', views.PreprintView.as_view(), name='preprint'), - re_path(r'^(?P[A-Za-z0-9_]+)/change_provider/$', views.PreprintProviderChangeView.as_view(), name='preprint-provider'), - re_path(r'^(?P[A-Za-z0-9_]+)/machine_state/$', views.PreprintMachineStateView.as_view(), name='preprint-machine-state'), - re_path(r'^(?P[A-Za-z0-9_]+)/reindex_share_preprint/$', views.PreprintReindexShare.as_view(), + # ^\w+(_[vV]\d+)*) + re_path(r'^(?P\w+(_[vV]\d+)*)/$', views.PreprintView.as_view(), name='preprint'), + re_path(r'^(?P\w+(_[vV]\d+)*)/change_provider/$', views.PreprintProviderChangeView.as_view(), name='preprint-provider'), + re_path(r'^(?P\w+(_[vV]\d+)*)/machine_state/$', views.PreprintMachineStateView.as_view(), name='preprint-machine-state'), + re_path(r'^(?P\w+(_[vV]\d+)*)/reindex_share_preprint/$', views.PreprintReindexShare.as_view(), name='reindex-share-preprint'), - re_path(r'^(?P[A-Za-z0-9_]+)/remove_user/(?P[a-z0-9]+)/$', views.PreprintRemoveContributorView.as_view(), + re_path(r'^(?P\w+(_[vV]\d+)*)/remove_user/(?P[a-z0-9]+)/$', views.PreprintRemoveContributorView.as_view(), name='remove-user'), - re_path(r'^(?P[A-Za-z0-9_]+)/make_private/$', views.PreprintMakePrivate.as_view(), name='make-private'), - re_path(r'^(?P[A-Za-z0-9_]+)/make_public/$', views.PreprintMakePublic.as_view(), name='make-public'), - re_path(r'^(?P[A-Za-z0-9_]+)/remove/$', views.PreprintDeleteView.as_view(), name='remove'), - re_path(r'^(?P[A-Za-z0-9_]+)/restore/$', views.PreprintDeleteView.as_view(), name='restore'), - re_path(r'^(?P[A-Za-z0-9_]+)/confirm_unflag/$', views.PreprintConfirmUnflagView.as_view(), name='confirm-unflag'), - re_path(r'^(?P[A-Za-z0-9_]+)/confirm_spam/$', views.PreprintConfirmSpamView.as_view(), name='confirm-spam'), - re_path(r'^(?P[A-Za-z0-9_]+)/confirm_ham/$', views.PreprintConfirmHamView.as_view(), name='confirm-ham'), - re_path(r'^(?P[A-Za-z0-9_]+)/reindex_elastic_preprint/$', views.PreprintReindexElastic.as_view(), + re_path(r'^(?P\w+(_[vV]\d+)*)/make_private/$', views.PreprintMakePrivate.as_view(), name='make-private'), + re_path(r'^(?P\w+(_[vV]\d+)*)/make_public/$', views.PreprintMakePublic.as_view(), name='make-public'), + re_path(r'^(?P\w+(_[vV]\d+)*)/remove/$', views.PreprintDeleteView.as_view(), name='remove'), + re_path(r'^(?P\w+(_[vV]\d+)*)/restore/$', views.PreprintDeleteView.as_view(), name='restore'), + re_path(r'^(?P\w+(_[vV]\d+)*)/confirm_unflag/$', views.PreprintConfirmUnflagView.as_view(), name='confirm-unflag'), + re_path(r'^(?P\w+(_[vV]\d+)*)/confirm_spam/$', views.PreprintConfirmSpamView.as_view(), name='confirm-spam'), + re_path(r'^(?P\w+(_[vV]\d+)*)/confirm_ham/$', views.PreprintConfirmHamView.as_view(), name='confirm-ham'), + re_path(r'^(?P\w+(_[vV]\d+)*)/reindex_elastic_preprint/$', views.PreprintReindexElastic.as_view(), name='reindex-elastic-preprint'), - re_path(r'^(?P[A-Za-z0-9_]+)/approve_withdrawal/$', views.PreprintApproveWithdrawalRequest.as_view(), + re_path(r'^(?P\w+(_[vV]\d+)*)/approve_withdrawal/$', views.PreprintApproveWithdrawalRequest.as_view(), name='approve-withdrawal'), - re_path(r'^(?P[A-Za-z0-9_]+)/reject_withdrawal/$', views.PreprintRejectWithdrawalRequest.as_view(), + re_path(r'^(?P\w+(_[vV]\d+)*)/reject_withdrawal/$', views.PreprintRejectWithdrawalRequest.as_view(), name='reject-withdrawal'), ] diff --git a/api/chronos/urls.py b/api/chronos/urls.py index 55efe089bb74..88cefa36cd34 100644 --- a/api/chronos/urls.py +++ b/api/chronos/urls.py @@ -7,6 +7,7 @@ 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_]+_[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), + # ^\w+(_[vV]\d+)*) + re_path(r'^(?P\w+(_[vV]\d+)*)/submissions/$', views.ChronosSubmissionList.as_view(), name=views.ChronosSubmissionList.view_name), + re_path(r'^(?P\w+(_[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 440143fb2893..effdc09fea21 100644 --- a/api/preprints/urls.py +++ b/api/preprints/urls.py @@ -5,23 +5,22 @@ 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_]+_[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), + re_path(r'^(?P\w+(_[vV]\d+)*)/$', views.PreprintDetail.as_view(), name=views.PreprintDetail.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/bibliographic_contributors/$', views.PreprintBibliographicContributorsList.as_view(), name=views.PreprintBibliographicContributorsList.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/citation/$', views.PreprintCitationDetail.as_view(), name=views.PreprintCitationDetail.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/citation/(?P[-\w]+)/$', views.PreprintCitationStyleDetail.as_view(), name=views.PreprintCitationStyleDetail.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/contributors/$', views.PreprintContributorsList.as_view(), name=views.PreprintContributorsList.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/contributors/(?P\w+)/$', views.PreprintContributorDetail.as_view(), name=views.PreprintContributorDetail.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/files/$', views.PreprintStorageProvidersList.as_view(), name=views.PreprintStorageProvidersList.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/files/osfstorage/$', views.PreprintFilesList.as_view(), name=views.PreprintFilesList.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/identifiers/$', views.PreprintIdentifierList.as_view(), name=views.PreprintIdentifierList.view_name), + re_path(r'^(?P^\w+(_[vV]\d+)*)/institutions/$', views.PreprintInstitutionsList.as_view(), name=views.PreprintInstitutionsList.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/relationships/institutions/$', views.PreprintInstitutionsRelationship.as_view(), name=views.PreprintInstitutionsRelationship.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/relationships/node/$', views.PreprintNodeRelationship.as_view(), name=views.PreprintNodeRelationship.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/relationships/subjects/$', views.PreprintSubjectsRelationship.as_view(), name=views.PreprintSubjectsRelationship.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/review_actions/$', views.PreprintActionList.as_view(), name=views.PreprintActionList.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/requests/$', views.PreprintRequestListCreate.as_view(), name=views.PreprintRequestListCreate.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/subjects/$', views.PreprintSubjectsList.as_view(), name=views.PreprintSubjectsList.view_name), + re_path(r'^(?P\w+(_[vV]\d+)*)/versions/$', views.PreprintVersionsList.as_view(), name=views.PreprintVersionsList.view_name), ]