Skip to content

Commit 95fd3d6

Browse files
committed
🚑(deps) update arrow usage for version 1.0
Arrow version 1.0 introduces some breaking changes arrow-py/arrow#832 timestamp property has been replaced by int_timestamp
1 parent 4656c58 commit 95fd3d6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
2222
- Fix autosuggest to redirect user directly on the course page when a course
2323
entry has been selected from the suggestion dropdown
2424
- Pin `django-treebeard` to `4.4` as the 4.5 release introduces BC
25+
- Code update to support arrow 1.0
2526

2627
## [2.1.0] - 2021-01-22
2728

src/richie/apps/search/forms.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def get_script_fields(self):
128128
"id": "state",
129129
"params": {
130130
"languages": self.cleaned_data.get("languages") or None,
131-
"ms_since_epoch": arrow.utcnow().timestamp * 1000,
131+
"ms_since_epoch": arrow.utcnow().int_timestamp * 1000,
132132
"states": self.states,
133133
"use_case": "field",
134134
},
@@ -167,8 +167,8 @@ def get_sorting_script(self):
167167
"id": "state",
168168
"params": {
169169
"languages": self.cleaned_data.get("languages") or None,
170-
"max_date": arrow.get(MAXYEAR, 12, 31).timestamp * 1000,
171-
"ms_since_epoch": arrow.utcnow().timestamp * 1000,
170+
"max_date": arrow.get(MAXYEAR, 12, 31).int_timestamp * 1000,
171+
"ms_since_epoch": arrow.utcnow().int_timestamp * 1000,
172172
"states": self.states,
173173
"use_case": "sorting",
174174
},

0 commit comments

Comments
 (0)