Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Merge ac6d075 into e4bc0de
Browse files Browse the repository at this point in the history
  • Loading branch information
leplatrem committed Sep 21, 2020
2 parents e4bc0de + ac6d075 commit 18cae26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ Changelog
3.1.0 (unreleased)
------------------

- Nothing changed yet.
**Bug fixes**

- Fix validation rule for ``_since`` query parameter


3.0.2 (2020-06-02)
Expand Down
4 changes: 2 additions & 2 deletions kinto_changes/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ class QuotedTimestamp(colander.SchemaNode):

schema_type = colander.String
error_message = "The value should be integer between double quotes."
validator = colander.Regex('^"([0-9]+?)"$|\\*', msg=error_message)
validator = colander.Regex('^"([0-9]+?)"$', msg=error_message)

def deserialize(self, cstruct=colander.null):
param = super(QuotedTimestamp, self).deserialize(cstruct)
if param is colander.drop:
return param
return int(param[1:-1])
return int(param.strip('"'))


class ChangeSetQuerystring(colander.MappingSchema):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_changeset.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ def test_changeset_is_not_publicly_accessible(self):
def test_timestamp_is_validated(self):
self.app.get(self.changeset_uri + "&_since=abc", headers=self.headers, status=400)
self.app.get(self.changeset_uri + "&_since=42", headers=self.headers, status=400)
self.app.get(self.changeset_uri + "&_since=*)(!(objectClass=*)", headers=self.headers, status=400)
self.app.get(self.changeset_uri + '&_since="42"', headers=self.headers)


def test_expected_param_is_mandatory(self):
self.app.get(self.changeset_uri.split("?")[0], headers=self.headers, status=400)

Expand Down

0 comments on commit 18cae26

Please sign in to comment.