fix: [Paste] create absolute path

pull/282/head
Terrtia 2018-10-24 15:16:12 +02:00
parent 15901d2865
commit 8a6ac6be1e
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
1 changed files with 4 additions and 0 deletions

View File

@ -82,6 +82,10 @@ class Paste(object):
db=cfg.getint("ARDB_Metadata", "db"),
decode_responses=True)
PASTES_FOLDER = os.path.join(os.environ['AIL_HOME'], cfg.get("Directories", "pastes"))
if PASTES_FOLDER not in p_path:
p_path = os.path.join(PASTES_FOLDER, p_path)
self.p_path = p_path
self.p_name = os.path.basename(self.p_path)
self.p_size = round(os.path.getsize(self.p_path)/1024.0, 2)