Skip to content

Commit 08397d0

Browse files
committed
Small fixes to backend.
1 parent 61c227c commit 08397d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mystbin/backend/routers/pastes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
__config = json.load(__f)
6363

6464
del __p, __f # micro-opt, don't keep unneeded variables in-ram
65-
HAS_BUNNYCDN = bool(__config["bunnycdn"]["token"])
65+
HAS_BUNNYCDN = bool(__config["bunny_cdn"]["token"])
6666

6767

6868
def generate_paste_id(n: int = 3):

mystbin/backend/utils/db.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ async def get_all_user_pastes(self, author_id: Optional[int], limit: int, page:
403403
The potential list of pastes.
404404
"""
405405
query = """
406-
SELECT id, author_id, created_at, views, expires
406+
SELECT id, author_id, created_at, views, expires,
407407
CASE WHEN password IS NOT NULL THEN true ELSE false END AS has_password
408408
FROM pastes
409409
WHERE author_id = $1
@@ -412,7 +412,7 @@ async def get_all_user_pastes(self, author_id: Optional[int], limit: int, page:
412412
OFFSET $3
413413
"""
414414

415-
assert page > 1 and limit > 1, ValueError("limit and page cannot be smaller than 1")
415+
assert page >= 1 and limit >= 1, ValueError("limit and page cannot be smaller than 1")
416416
response = await self._do_query(query, author_id, limit, page - 1)
417417
if not response:
418418
return []

0 commit comments

Comments
 (0)