Bugfixes with blog and photo albums
This commit is contained in:
parent
b36e764507
commit
1d3dc51bca
|
@ -45,12 +45,14 @@ 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":
|
||||
del db[post_id]
|
||||
continue
|
||||
new_db[post_id] = db[post_id]
|
||||
|
||||
return db
|
||||
return new_db
|
||||
|
||||
|
||||
def rebuild_index():
|
||||
|
|
|
@ -43,6 +43,9 @@ def album_index(name):
|
|||
|
||||
g.info["album"] = name
|
||||
g.info["album_info"] = Photo.get_album(name)
|
||||
if not g.info["album_info"]:
|
||||
flash("That photo album wasn't found!")
|
||||
return redirect(url_for(".albums"))
|
||||
g.info["markdown"] = render_markdown(g.info["album_info"]["description"])
|
||||
g.info["photos"] = photos
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user