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

[Fixes 12766] New fixes regarding the Timeseries API #12853

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
black reformat
  • Loading branch information
Gpetrak committed Jan 28, 2025
commit a7fc1666c31283a82429bb2fe266ff4b21aa478d
4 changes: 2 additions & 2 deletions geonode/layers/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ def __init__(self, *args, **kwargs):
"Continuous Intervals for data that is frequently updated, resolution describes the frequency of updates",
),
],
default="LIST"
default="LIST",
)
precision_value = serializers.IntegerField(required=False, allow_null=True)
precision_step = serializers.ChoiceField(
required=False,
choices=[("years",) * 2, ("months",) * 2, ("days",) * 2, ("hours",) * 2, ("minutes",) * 2, ("seconds",) * 2],
default="seconds"
default="seconds",
)
11 changes: 5 additions & 6 deletions geonode/layers/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ def timeseries_info(self, request, pk, *args, **kwards):
)

if start_attr is None and end_attr is None:
return JsonResponse({"message": "Please select at least one option between the attribute and end_attribute"}, status=200)
return JsonResponse(
{"message": "Please select at least one option between the attribute and end_attribute"},
status=200,
)

# Save the has_time value to the database
layer.has_time = True
Expand Down Expand Up @@ -291,8 +294,4 @@ def timeseries_info(self, request, pk, *args, **kwards):
layer.has_time = False
layer.save()

return JsonResponse(
{
"message": "The time dimension information for this layer was disabled"
}
)
return JsonResponse({"message": "The time dimension information for this layer was disabled"})