mirror of https://git.sr.ht/~sircmpwn/hub.sr.ht
Do not show profiles of suspended accounts
This should likely be extended to other services as well, but the hub is certainly a good point to start.
This commit is contained in:
parent
32bedb1524
commit
9670ee1409
|
@ -4,14 +4,16 @@ from flask import Blueprint, render_template, request, abort
|
|||
from hubsrht.types import User, Project, Visibility, Event, EventType
|
||||
from hubsrht.types import SourceRepo, MailingList, Tracker
|
||||
from srht.flask import paginate_query
|
||||
from srht.oauth import current_user
|
||||
from srht.oauth import current_user, UserType
|
||||
from srht.search import search_by
|
||||
|
||||
users = Blueprint("users", __name__)
|
||||
|
||||
@users.route("/~<username>/")
|
||||
def summary_GET(username):
|
||||
user = User.query.filter(User.username == username).first()
|
||||
user = (User.query
|
||||
.filter(User.username == username)
|
||||
.filter(User.user_type != UserType.suspended)).first()
|
||||
if not user:
|
||||
abort(404)
|
||||
projects = (Project.query
|
||||
|
|
Loading…
Reference in New Issue