From 23b5eecba0176c00f199fd9ce459637f92d12787 Mon Sep 17 00:00:00 2001 From: Steve Hay Date: Wed, 31 Aug 2022 10:04:59 -0400 Subject: [PATCH] fixes recent pastes default bug (#22) Co-authored-by: root --- pastey/functions.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pastey/functions.py b/pastey/functions.py index 0564494..66b4cf6 100644 --- a/pastey/functions.py +++ b/pastey/functions.py @@ -8,9 +8,12 @@ from cryptography.fernet import Fernet import time import uuid import json +from os import environ ########## Paste functions ########## +config.recent_pastes = int(environ["PASTEY_RECENT_PASTES"]) if "PASTEY_RECENT_PASTES" in environ else config.recent_pastes + # Get recent n pastes, defined in config by recent_pastes def get_recent(limit=config.recent_pastes): paths = sorted(Path(config.data_directory).iterdir(), key=path.getmtime, reverse=True)