Browse Source

Bugfixes with blog and photo albums

pull/2/head
Noah Petherbridge 4 years ago
parent
commit
1d3dc51bca
2 changed files with 7 additions and 2 deletions
  1. +4
    -2
      rophako/model/blog.py
  2. +3
    -0
      rophako/modules/photo/__init__.py

+ 4
- 2
rophako/model/blog.py View File

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


+ 3
- 0
rophako/modules/photo/__init__.py View File

@@ -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…
Cancel
Save