fix. Sidebar manage with wip/publish

This commit is contained in:
Cyrille L 2023-02-15 12:33:13 +01:00
parent c95cf9dc67
commit e65a92d38a
1 changed files with 15 additions and 7 deletions

View File

@ -280,19 +280,27 @@ def create_sidebar(option):
hash_uri = tyto.get_filesum(f_uri, False) hash_uri = tyto.get_filesum(f_uri, False)
db_uri = '%s%s.conf'%(db.articles_db, hash_uri) db_uri = '%s%s.conf'%(db.articles_db, hash_uri)
if not os.path.exists(db_uri): if not os.path.exists(db_uri):
logs.out('25', 'No Database', False) logs.out('25', line, False)
continue continue
# Load article"s database # Load article"s database
exec(open(db_uri).read(),globals()) exec(open(db_uri).read(),globals())
# Check wip status and if wip article exists # Check wip status and if wip article exists
if option == 'wip':
if not hash_wip == hash_chk: if not hash_wip == hash_chk:
logs.out("30", '%s "%s"'%(line, title), False) logs.out("30", '%s "%s"'%(line, title), False)
continue continue
if not os.path.exists(post_wip): if not os.path.exists(post_wip):
logs.out("24", 'in wip: %s'%post_wip, False) logs.out("24", 'in wip: %s'%post_wip, False)
continue continue
elif option == 'www':
if not hash_www == hash_chk:
logs.out("30", '%s "%s"'%(line, title), False)
continue
if not os.path.exists(post_www):
logs.out("24", 'in www: %s'%post_www, False)
continue
# Valid article # Valid article
sidebar_new = True sidebar_new = True