Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-6859] Update regex for versioned guids #10908

Open
wants to merge 2 commits into
base: feature/preprints-doi-versioning
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions admin/preprints/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<guid>[A-Za-z0-9_]+)/$', views.PreprintView.as_view(), name='preprint'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/change_provider/$', views.PreprintProviderChangeView.as_view(), name='preprint-provider'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/machine_state/$', views.PreprintMachineStateView.as_view(), name='preprint-machine-state'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/reindex_share_preprint/$', views.PreprintReindexShare.as_view(),
# ^\w+(_[vV]\d+)*)
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/$', views.PreprintView.as_view(), name='preprint'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/change_provider/$', views.PreprintProviderChangeView.as_view(), name='preprint-provider'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/machine_state/$', views.PreprintMachineStateView.as_view(), name='preprint-machine-state'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/reindex_share_preprint/$', views.PreprintReindexShare.as_view(),
name='reindex-share-preprint'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/remove_user/(?P<user_id>[a-z0-9]+)/$', views.PreprintRemoveContributorView.as_view(),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/remove_user/(?P<user_id>[a-z0-9]+)/$', views.PreprintRemoveContributorView.as_view(),
name='remove-user'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/make_private/$', views.PreprintMakePrivate.as_view(), name='make-private'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/make_public/$', views.PreprintMakePublic.as_view(), name='make-public'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/remove/$', views.PreprintDeleteView.as_view(), name='remove'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/restore/$', views.PreprintDeleteView.as_view(), name='restore'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/confirm_unflag/$', views.PreprintConfirmUnflagView.as_view(), name='confirm-unflag'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/confirm_spam/$', views.PreprintConfirmSpamView.as_view(), name='confirm-spam'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/confirm_ham/$', views.PreprintConfirmHamView.as_view(), name='confirm-ham'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/reindex_elastic_preprint/$', views.PreprintReindexElastic.as_view(),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/make_private/$', views.PreprintMakePrivate.as_view(), name='make-private'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/make_public/$', views.PreprintMakePublic.as_view(), name='make-public'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/remove/$', views.PreprintDeleteView.as_view(), name='remove'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/restore/$', views.PreprintDeleteView.as_view(), name='restore'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/confirm_unflag/$', views.PreprintConfirmUnflagView.as_view(), name='confirm-unflag'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/confirm_spam/$', views.PreprintConfirmSpamView.as_view(), name='confirm-spam'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/confirm_ham/$', views.PreprintConfirmHamView.as_view(), name='confirm-ham'),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/reindex_elastic_preprint/$', views.PreprintReindexElastic.as_view(),
name='reindex-elastic-preprint'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/approve_withdrawal/$', views.PreprintApproveWithdrawalRequest.as_view(),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/approve_withdrawal/$', views.PreprintApproveWithdrawalRequest.as_view(),
name='approve-withdrawal'),
re_path(r'^(?P<guid>[A-Za-z0-9_]+)/reject_withdrawal/$', views.PreprintRejectWithdrawalRequest.as_view(),
re_path(r'^(?P<guid>\w+(_[vV]\d+)*)/reject_withdrawal/$', views.PreprintRejectWithdrawalRequest.as_view(),
name='reject-withdrawal'),
]
5 changes: 3 additions & 2 deletions api/chronos/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
urlpatterns = [
re_path(r'^journals/$', views.ChronosJournalList.as_view(), name=views.ChronosJournalList.view_name),
re_path(r'^journals/(?P<journal_id>[-0-9A-Za-z]+)/$', views.ChronosJournalDetail.as_view(), name=views.ChronosJournalDetail.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/submissions/$', views.ChronosSubmissionList.as_view(), name=views.ChronosSubmissionList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/submissions/(?P<submission_id>[-0-9A-Za-z]+)/$', views.ChronosSubmissionDetail.as_view(), name=views.ChronosSubmissionDetail.view_name),
# ^\w+(_[vV]\d+)*)
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/submissions/$', views.ChronosSubmissionList.as_view(), name=views.ChronosSubmissionList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/submissions/(?P<submission_id>[-0-9A-Za-z]+)/$', views.ChronosSubmissionDetail.as_view(), name=views.ChronosSubmissionDetail.view_name),
]
34 changes: 17 additions & 17 deletions api/preprints/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@

urlpatterns = [
re_path(r'^$', views.PreprintList.as_view(), name=views.PreprintList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/$', views.PreprintDetail.as_view(), name=views.PreprintDetail.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/bibliographic_contributors/$', views.PreprintBibliographicContributorsList.as_view(), name=views.PreprintBibliographicContributorsList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/citation/$', views.PreprintCitationDetail.as_view(), name=views.PreprintCitationDetail.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/citation/(?P<style_id>[-\w]+)/$', views.PreprintCitationStyleDetail.as_view(), name=views.PreprintCitationStyleDetail.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/contributors/$', views.PreprintContributorsList.as_view(), name=views.PreprintContributorsList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/contributors/(?P<user_id>\w+)/$', views.PreprintContributorDetail.as_view(), name=views.PreprintContributorDetail.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/files/$', views.PreprintStorageProvidersList.as_view(), name=views.PreprintStorageProvidersList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/files/osfstorage/$', views.PreprintFilesList.as_view(), name=views.PreprintFilesList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/identifiers/$', views.PreprintIdentifierList.as_view(), name=views.PreprintIdentifierList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/institutions/$', views.PreprintInstitutionsList.as_view(), name=views.PreprintInstitutionsList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/relationships/institutions/$', views.PreprintInstitutionsRelationship.as_view(), name=views.PreprintInstitutionsRelationship.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/relationships/node/$', views.PreprintNodeRelationship.as_view(), name=views.PreprintNodeRelationship.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/relationships/subjects/$', views.PreprintSubjectsRelationship.as_view(), name=views.PreprintSubjectsRelationship.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/review_actions/$', views.PreprintActionList.as_view(), name=views.PreprintActionList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/requests/$', views.PreprintRequestListCreate.as_view(), name=views.PreprintRequestListCreate.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/subjects/$', views.PreprintSubjectsList.as_view(), name=views.PreprintSubjectsList.view_name),
re_path(r'^(?P<preprint_id>[A-Za-z0-9_]+)/versions/$', views.PreprintVersionsList.as_view(), name=views.PreprintVersionsList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/$', views.PreprintDetail.as_view(), name=views.PreprintDetail.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/bibliographic_contributors/$', views.PreprintBibliographicContributorsList.as_view(), name=views.PreprintBibliographicContributorsList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/citation/$', views.PreprintCitationDetail.as_view(), name=views.PreprintCitationDetail.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/citation/(?P<style_id>[-\w]+)/$', views.PreprintCitationStyleDetail.as_view(), name=views.PreprintCitationStyleDetail.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/contributors/$', views.PreprintContributorsList.as_view(), name=views.PreprintContributorsList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/contributors/(?P<user_id>\w+)/$', views.PreprintContributorDetail.as_view(), name=views.PreprintContributorDetail.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/files/$', views.PreprintStorageProvidersList.as_view(), name=views.PreprintStorageProvidersList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/files/osfstorage/$', views.PreprintFilesList.as_view(), name=views.PreprintFilesList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/identifiers/$', views.PreprintIdentifierList.as_view(), name=views.PreprintIdentifierList.view_name),
re_path(r'^(?P<preprint_id>^\w+(_[vV]\d+)*)/institutions/$', views.PreprintInstitutionsList.as_view(), name=views.PreprintInstitutionsList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/relationships/institutions/$', views.PreprintInstitutionsRelationship.as_view(), name=views.PreprintInstitutionsRelationship.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/relationships/node/$', views.PreprintNodeRelationship.as_view(), name=views.PreprintNodeRelationship.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/relationships/subjects/$', views.PreprintSubjectsRelationship.as_view(), name=views.PreprintSubjectsRelationship.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/review_actions/$', views.PreprintActionList.as_view(), name=views.PreprintActionList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/requests/$', views.PreprintRequestListCreate.as_view(), name=views.PreprintRequestListCreate.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/subjects/$', views.PreprintSubjectsList.as_view(), name=views.PreprintSubjectsList.view_name),
re_path(r'^(?P<preprint_id>\w+(_[vV]\d+)*)/versions/$', views.PreprintVersionsList.as_view(), name=views.PreprintVersionsList.view_name),
]
Loading