-
Notifications
You must be signed in to change notification settings - Fork 11
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
fixed invalid url old timerseries #494
fixed invalid url old timerseries #494
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The commit message needs proper capitalization and spelling, and should also be in the imperative. It should also have
(fixes #493)
in the end. (See also "Git and GitHub" [section "Commit and commit messages"] in Confluence.) - I found out that this problem also occurs in the new URLs after all, not only in the deprecated; for example, under
/api/stations/2012/timeseriesgroups/584/timeseries/{hello}/data/
. This means the commit message should not mention the "old" URL. It could be, for example,Fix crash in invalid timeseries URL (fixes #493)
.
.DS_STORE | ||
.idea/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Please don't make irrelevant changes in the commit (see also "Git and GitHub" (section "Committing and commit messages") in Confluence)
- Please don't store in
.gitignore
things related to your personal development environment. You can use your personal.gitignore
file for that (it's probably~/.gitignore
.
@@ -237,7 +238,7 @@ def data(self, request, pk=None, *, station_id, timeseries_group_id=None): | |||
|
|||
@action(detail=True, methods=["get"]) | |||
def bottom(self, request, pk=None, *, station_id, timeseries_group_id=None): | |||
ts = get_object_or_404(models.Timeseries, pk=pk) | |||
ts = get_object_or_404(models.Timeseries, pk=int(pk)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this working before? If yes, why is this change needed? (And how on earth was it working?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @aptiko it was working fine, just make it consistent for the views
@@ -246,7 +247,7 @@ def bottom(self, request, pk=None, *, station_id, timeseries_group_id=None): | |||
|
|||
@action(detail=True, methods=["get"]) | |||
def chart(self, request, pk=None, *, station_id, timeseries_group_id=None): | |||
timeseries = get_object_or_404(models.Timeseries, pk=pk) | |||
timeseries = get_object_or_404(models.Timeseries, pk=int(pk)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question.
@@ -167,6 +167,7 @@ class TimeseriesViewSet(ModelViewSet): | |||
CHART_MAX_INTERVALS = 200 | |||
queryset = models.Timeseries.objects.all() | |||
serializer_class = serializers.TimeseriesSerializer | |||
lookup_value_regex = '\d+' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this line is added, then I can't reproduce the problem any more. If that is the case, why do we have the try...except
in _get_data()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aptiko added try catch at _get_data()
here bcz it's not the direct part of view, can be called anywhere from the code
Closed in favor of #495 (renamed the branch) |
Checklist: