Skip to content

Commit

Permalink
Add Django 4.2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Aug 21, 2023
1 parent dad8b61 commit 2757596
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion afs/tasks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from celery import shared_task
from django.contrib.auth.models import User
from django.http import HttpRequest
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from arches.app.models.models import SearchExportHistory
from arches.app.models.system_settings import settings

Expand Down
47 changes: 23 additions & 24 deletions afs/urls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from django.conf.urls import url
from django.conf import settings
from django.urls import path, include
from django.urls import include, path, re_path
from django.conf.urls.static import static
from afs.views.temp_file import TempFileView
from arches.app.views.plugin import PluginView
Expand All @@ -25,43 +24,43 @@
uuid_regex = settings.UUID_REGEX

urlpatterns = [
url(r"^physical-thing-search-results", PhysicalThingSearchView.as_view(), name="physical-thing-search-results"),
url(r"^physical-things-in-set", PhysicalThingSetView.as_view(), name="physical_things_set"),
url(
re_path(r"^physical-thing-search-results", PhysicalThingSearchView.as_view(), name="physical-thing-search-results"),
re_path(r"^physical-things-in-set", PhysicalThingSetView.as_view(), name="physical_things_set"),
re_path(
r"^digital-resources-by-object-parts/(?P<resourceid>%s)$" % uuid_regex,
DigitalResourcesByObjectParts.as_view(),
name="digital-resources-by-object-parts",
),
url(
re_path(
r"^workflows/upload-dataset-workflow/select-dataset-files-step",
SelectDatasetFilesStep.as_view(),
name="upload_dataset_select_dataset_files_step",
),
url(
re_path(
r"^workflows/upload-dataset-workflow/file-renderer/(?P<tileid>%s)$" % uuid_regex,
UpdateFileFormat.as_view(),
name="upload_dataset_file_renderer",
),
url(
re_path(
r"^workflows/upload-dataset-workflow/get-format-renderer/(?P<format>[0-9a-zA-Z_\-./]*)$",
FormatRenderMap.as_view(),
name="format_render_map",
),
url(r"^updateresourcelist", UpdateResourceListView.as_view(), name="updateresourcelist"),
url(r"^s3/multipart/(?P<uploadid>[^\/]+)/complete$", complete_upload, name="s3_multipart_upload_complete"),
url(r"^s3/multipart/(?P<uploadid>[^\/]+)/batch", batch_sign, name="s3_multipart_batch_sign"),
url(r"^s3/multipart/(?P<uploadid>[^\/]+)/(?P<partnumber>\d+)$", upload_part, name="s3_multipart_upload_part"),
url(r"^s3/multipart/(?P<uploadid>[^\/]+)", S3MultipartUploadManagerView.as_view(), name="s3_multipart_upload"),
url(r"^s3/multipart$", S3MultipartUploaderView.as_view(), name="s3_multipart_upload"),
url(r"^instrument-info-form-save", InstrumentInfoStepFormSaveView.as_view(), name="instrument-info-form-save"),
url(r"^saveanalysisarea", SaveAnalysisAreaView.as_view(), name="saveanalysisarea"),
url(r"^savesamplearea", SaveSampleAreaView.as_view(), name="savesamplearea"),
url(r"^deletesamplearea", DeleteSampleAreaView.as_view(), name="deletesamplearea"),
url(r"^deleteanalysisarea", DeleteAnalysisAreaView.as_view(), name="deleteanalysisarea"),
url(r"^analysisarealocked", GetLockedStatus.as_view(), name="analysisarealocked"),
url(r"^download_project_files", FileDownloader.as_view(), name="download_project_files"),
url(r"^temp_file/(?P<file_id>[^\/]+)", TempFileView.as_view(), name="temp_file"),
url(r"^temp_file$", TempFileView.as_view(), name="temp_file"),
re_path(r"^updateresourcelist", UpdateResourceListView.as_view(), name="updateresourcelist"),
re_path(r"^s3/multipart/(?P<uploadid>[^\/]+)/complete$", complete_upload, name="s3_multipart_upload_complete"),
re_path(r"^s3/multipart/(?P<uploadid>[^\/]+)/batch", batch_sign, name="s3_multipart_batch_sign"),
re_path(r"^s3/multipart/(?P<uploadid>[^\/]+)/(?P<partnumber>\d+)$", upload_part, name="s3_multipart_upload_part"),
re_path(r"^s3/multipart/(?P<uploadid>[^\/]+)", S3MultipartUploadManagerView.as_view(), name="s3_multipart_upload"),
re_path(r"^s3/multipart$", S3MultipartUploaderView.as_view(), name="s3_multipart_upload"),
re_path(r"^instrument-info-form-save", InstrumentInfoStepFormSaveView.as_view(), name="instrument-info-form-save"),
re_path(r"^saveanalysisarea", SaveAnalysisAreaView.as_view(), name="saveanalysisarea"),
re_path(r"^savesamplearea", SaveSampleAreaView.as_view(), name="savesamplearea"),
re_path(r"^deletesamplearea", DeleteSampleAreaView.as_view(), name="deletesamplearea"),
re_path(r"^deleteanalysisarea", DeleteAnalysisAreaView.as_view(), name="deleteanalysisarea"),
re_path(r"^analysisarealocked", GetLockedStatus.as_view(), name="analysisarealocked"),
re_path(r"^download_project_files", FileDownloader.as_view(), name="download_project_files"),
re_path(r"^temp_file/(?P<file_id>[^\/]+)", TempFileView.as_view(), name="temp_file"),
re_path(r"^temp_file$", TempFileView.as_view(), name="temp_file"),
path("reports/", include("arches_templating.urls")),
url(r"^", include("arches.urls")),
path("", include("arches.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
2 changes: 1 addition & 1 deletion afs/views/analysis_area_and_sample_taking.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.generic import View
from django.views.decorators.csrf import csrf_exempt
from django.utils.translation import get_language, get_language_bidi
Expand Down
2 changes: 1 addition & 1 deletion afs/views/download_project_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.contrib.auth.models import User
from django.core.files import File
from django.http import HttpRequest
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.generic import View
from arches.app.models import models
from arches.app.utils.response import JSONResponse, JSONErrorResponse
Expand Down
2 changes: 1 addition & 1 deletion afs/views/physical_thing_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.views.generic import View
from arches.app.search.search_engine_factory import SearchEngineFactory
from django.http import HttpResponseNotFound
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.shortcuts import render
from datetime import datetime
from arches.app.search.components.base import SearchFilterFactory
Expand Down
2 changes: 1 addition & 1 deletion afs/views/temp_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
import uuid
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.generic import View
from arches.app.models.models import TempFile
from arches.app.utils.response import JSONResponse
Expand Down
2 changes: 1 addition & 1 deletion afs/views/update_resource_list.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from django.utils.translation import ugettext as _
from django.utils.translation import gettext as _
from django.views.generic import View
from arches.app.datatypes.datatypes import StringDataType, DataTypeFactory
from arches.app.models.tile import Tile
Expand Down

0 comments on commit 2757596

Please sign in to comment.