forked from indymedia/epicyon
No negative page numbers
parent
3de6c87e51
commit
3fe81d8d81
8
posts.py
8
posts.py
|
@ -2510,6 +2510,8 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
|
|
||||||
pageStr = '?page=true'
|
pageStr = '?page=true'
|
||||||
if pageNumber:
|
if pageNumber:
|
||||||
|
if pageNumber < 1:
|
||||||
|
pageNumber = 1
|
||||||
try:
|
try:
|
||||||
pageStr = '?page=' + str(pageNumber)
|
pageStr = '?page=' + str(pageNumber)
|
||||||
except BaseException:
|
except BaseException:
|
||||||
|
@ -2517,15 +2519,15 @@ def createBoxIndexed(recentPostsCache: {},
|
||||||
boxUrl = httpPrefix + '://' + domain + '/users/' + nickname + '/' + boxname
|
boxUrl = httpPrefix + '://' + domain + '/users/' + nickname + '/' + boxname
|
||||||
boxHeader = {
|
boxHeader = {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
'first': boxUrl+'?page=true',
|
'first': boxUrl + '?page=true',
|
||||||
'id': boxUrl,
|
'id': boxUrl,
|
||||||
'last': boxUrl+'?page=true',
|
'last': boxUrl + '?page=true',
|
||||||
'totalItems': 0,
|
'totalItems': 0,
|
||||||
'type': 'OrderedCollection'
|
'type': 'OrderedCollection'
|
||||||
}
|
}
|
||||||
boxItems = {
|
boxItems = {
|
||||||
'@context': 'https://www.w3.org/ns/activitystreams',
|
'@context': 'https://www.w3.org/ns/activitystreams',
|
||||||
'id': boxUrl+pageStr,
|
'id': boxUrl + pageStr,
|
||||||
'orderedItems': [
|
'orderedItems': [
|
||||||
],
|
],
|
||||||
'partOf': boxUrl,
|
'partOf': boxUrl,
|
||||||
|
|
Loading…
Reference in New Issue