File tree 2 files changed +11
-1
lines changed
src/aleph/web/controllers
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 14
14
LIST_FIELD_SEPARATOR ,
15
15
Pagination ,
16
16
cond_output ,
17
+ make_date_filters ,
17
18
)
18
19
19
20
LOGGER = logging .getLogger (__name__ )
@@ -175,6 +176,15 @@ class MessageQueryParams(BaseMessageQueryParams):
175
176
"a time field lower than this value will be returned." ,
176
177
)
177
178
179
+ def to_filter_list (self ) -> List [Mapping [str , Any ]]:
180
+ filters = super ().to_filter_list ()
181
+ date_filters = make_date_filters (
182
+ start = self .start_date , end = self .end_date , filter_key = "time"
183
+ )
184
+ if date_filters :
185
+ filters .append (date_filters )
186
+ return filters
187
+
178
188
179
189
class WsMessageQueryParams (BaseMessageQueryParams ):
180
190
history : Optional [int ] = Field (
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ async def fetch_messages_filter_time_expect_success(
171
171
@pytest .mark .asyncio
172
172
async def test_time_filters (fixture_messages , ccn_api_client ):
173
173
# Start and end time specified, should return all messages
174
- start_time , end_time = 164821580 , 1648215820
174
+ start_time , end_time = 1648215900 , 1652126600
175
175
messages = await fetch_messages_filter_time_expect_success (
176
176
ccn_api_client , start = start_time , end = end_time
177
177
)
You can’t perform that action at this time.
0 commit comments