瀏覽代碼

Retry on private blog entry logic

pull/2/head
Noah Petherbridge 5 年之前
父節點
當前提交
7edb2f21bc
共有 1 個檔案被更改,包括 5 行新增6 行删除
  1. +5
    -6
      rophako/model/blog.py

+ 5
- 6
rophako/model/blog.py 查看文件

@@ -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():


Loading…
取消
儲存