1
0
Derivar 0

Retry on private blog entry logic

pull/2/head
Noah 2016-04-19 22:46:49 +00:00
ascendente 1d3dc51bca
cometimento 7edb2f21bc
1 ficheiros modificados com 5 adições e 6 eliminações

Ver ficheiro

@ -45,14 +45,13 @@ def get_index():
db = JsonDB.get("blog/index")
# Hide any private posts if we aren't logged in.
new_db = dict()
if not g.info["session"]["login"]:
for post_id, data in db.items():
if data["privacy"] == "private":
continue
new_db[post_id] = db[post_id]
posts = list(db.keys())
for post_id in posts:
if db[post_id]["privacy"] == "private":
del db[post_id]
return new_db
return db
def rebuild_index():