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

feat: change depth interval preset #1021

Merged
merged 23 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a436900
feat: Get geojson field for geospatial data entries
josebui Oct 20, 2023
50690a5
feat: Added description to visualization config
josebui Oct 20, 2023
a0b1475
feat: Added description to visualization mutation
josebui Oct 23, 2023
6c44d31
fix: Added geojson case
josebui Oct 23, 2023
e185a1f
fix: (WIP) visualization mapbox tileset
josebui Oct 24, 2023
9623131
fix: Description optional
josebui Oct 24, 2023
4108424
fix: Create mapbox tileset for GIS formats
josebui Oct 24, 2023
83e29cf
fix: Fixed migration number
josebui Oct 24, 2023
c639806
fix: Read GIS files as binary
josebui Oct 25, 2023
27aebe3
fix: Using validation error instead of valueerror
josebui Oct 25, 2023
d91a7f1
Update terraso_backend/apps/core/gis/parsers.py
josebui Oct 26, 2023
de01310
fix: Renamed migration
josebui Nov 6, 2023
00f57d6
fix: Optimized data entries query
josebui Nov 8, 2023
4304444
fix: Removed not needed separate data entries field
josebui Nov 8, 2023
1c8d33e
fix: Moved queryset function
josebui Nov 8, 2023
c0b4d9b
fix: Added comments explaining custom queryset
josebui Nov 9, 2023
1c7ea5e
build: Merge branch 'fix/optimize-data-entries' into staging
josebui Nov 9, 2023
1912ae4
feat: Increased data entry size to 50 MB and added image formats
josebui Nov 10, 2023
4727d86
build: Merge branch 'feat/media-images-shared-data' into staging
josebui Nov 10, 2023
492cd1a
chore: Merge branch 'main' into staging
Nov 14, 2023
3f62a65
feat: Handle user changing depth interval preset
Dec 1, 2023
1b1f6a6
chore: Add migration for site depth interval preset
Dec 4, 2023
5f2e630
chore: Create migration
Dec 4, 2023
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
Prev Previous commit
Next Next commit
feat: Increased data entry size to 50 MB and added image formats
  • Loading branch information
josebui committed Nov 10, 2023
commit 1912ae4f919b9afe984069d479d505cac7014eb3
13 changes: 11 additions & 2 deletions terraso_backend/config/settings.py
Original file line number Diff line number Diff line change
@@ -326,8 +326,17 @@
".zip": ["application/zip"],
}

DATA_ENTRY_MEDIA_TYPES = {
".jpg": ["image/jpeg"],
".jpeg": ["image/jpeg"],
".png": ["image/png"],
}

DATA_ENTRY_ACCEPTED_TYPES = (
DATA_ENTRY_DOCUMENT_TYPES | DATA_ENTRY_SPREADSHEET_TYPES | DATA_ENTRY_GIS_TYPES
DATA_ENTRY_DOCUMENT_TYPES
| DATA_ENTRY_SPREADSHEET_TYPES
| DATA_ENTRY_GIS_TYPES
| DATA_ENTRY_MEDIA_TYPES
)
DATA_ENTRY_ACCEPTED_EXTENSIONS = list(DATA_ENTRY_ACCEPTED_TYPES.keys())

@@ -360,7 +369,7 @@
RENDER_API_TOKEN = config("RENDER_API_TOKEN", default="")

DATA_UPLOAD_MAX_MEMORY_SIZE = 70000000 # 70MB
MEDIA_UPLOAD_MAX_FILE_SIZE = 10000000 # 10MB
MEDIA_UPLOAD_MAX_FILE_SIZE = 50000000 # 50MB

STORY_MAP_MEDIA_S3_BUCKET = config("STORY_MAP_MEDIA_S3_BUCKET", default="")
STORY_MAP_MEDIA_BASE_URL = f"https://{STORY_MAP_MEDIA_S3_BUCKET}"
2 changes: 1 addition & 1 deletion terraso_backend/tests/shared_data/test_views.py
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ def data_entry_payload(request, group, landscape):
@pytest.mark.parametrize("data_entry_payload", ["group", "landscape"], indirect=True)
@mock.patch("apps.storage.file_utils.get_file_size")
def test_create_oversized_data_entry(mock_get_size, logged_client, upload_url, data_entry_payload):
mock_get_size.return_value = 10000001
mock_get_size.return_value = 50000001
with patch(
"apps.shared_data.forms.data_entry_upload_service.upload_file"
) as mocked_upload_service:
6 changes: 4 additions & 2 deletions terraso_backend/tests/storage/test_views.py
Original file line number Diff line number Diff line change
@@ -76,9 +76,11 @@ def test_create_data_entry_successfully(logged_client, landscape_profile_image_p


@mock.patch("apps.storage.file_utils.get_file_size")
def test_create_oversized_data_entry(mock_get_size, logged_client, landscape_profile_image_payload):
def test_create_oversized_profile_image(
mock_get_size, logged_client, landscape_profile_image_payload
):
url = reverse("terraso_storage:landscape-profile-image")
mock_get_size.return_value = 10000001
mock_get_size.return_value = 50000001
with patch(
"apps.storage.forms.profile_image_upload_service.upload_file"
) as mocked_upload_service:
2 changes: 1 addition & 1 deletion terraso_backend/tests/story_map/test_views.py
Original file line number Diff line number Diff line change
@@ -162,7 +162,7 @@ def test_update_oversized_media_upload(mock_get_size, logged_client, users):
}
),
}
mock_get_size.return_value = 10000001
mock_get_size.return_value = 50000001
with patch(
"apps.story_map.views.story_map_media_upload_service.upload_file_get_path"
) as mocked_upload_service: