mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Bugfix in the collection for the last empty page
This commit is contained in:
parent
7237fbcc68
commit
e3cf7d9ee6
1 changed files with 10 additions and 0 deletions
|
@ -646,6 +646,16 @@ def build_ordered_collection(
|
||||||
data = list(col.find(q, limit=limit).sort("_id", -1))
|
data = list(col.find(q, limit=limit).sort("_id", -1))
|
||||||
|
|
||||||
if not data:
|
if not data:
|
||||||
|
# Returns an empty page if there's a cursor
|
||||||
|
if cursor:
|
||||||
|
return {
|
||||||
|
"@context": ap.COLLECTION_CTX,
|
||||||
|
"type": ap.ActivityType.ORDERED_COLLECTION_PAGE.value,
|
||||||
|
"id": BASE_URL + "/" + col_name + "?cursor=" + cursor,
|
||||||
|
"partOf": BASE_URL + "/" + col_name,
|
||||||
|
"totalItems": 0,
|
||||||
|
"oredredItems": [],
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
"@context": ap.COLLECTION_CTX,
|
"@context": ap.COLLECTION_CTX,
|
||||||
"id": BASE_URL + "/" + col_name,
|
"id": BASE_URL + "/" + col_name,
|
||||||
|
|
Loading…
Reference in a new issue