diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-05-29 17:15:53 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-05-29 17:15:53 +0100 |
| commit | 7e80adad5621013e5840ac43281cff149fa15842 (patch) | |
| tree | 1788faa0ce5b9c5252ade3aad7a1b2a4c55f6bf7 /app/views | |
| parent | bf5080aa18c7ea16f1144850c80d739d304498ae (diff) | |
| download | cheatdb-7e80adad5621013e5840ac43281cff149fa15842.tar.xz | |
Fix soft deleted and unapproved packages appearing where they shouldn't
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/users.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/views/users.py b/app/views/users.py index 62bc6f2..b68c103 100644 --- a/app/views/users.py +++ b/app/views/users.py @@ -49,6 +49,10 @@ def user_profile_page(username): if not user: abort(404) + packages = user.packages.filter_by(soft_deleted=False) + if not current_user.is_authenticated or (user != current_user and not current_user.canAccessTodoList()): + packages = packages.filter_by(approved=True) + form = None if user.checkPerm(current_user, Permission.CHANGE_DNAME) or \ user.checkPerm(current_user, Permission.CHANGE_EMAIL) or \ @@ -92,7 +96,7 @@ def user_profile_page(username): # Process GET or invalid POST return render_template("users/user_profile_page.html", - user=user, form=form) + user=user, form=form, packages=packages) @app.route("/users/claim/", methods=["GET", "POST"]) |
