mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Fix crash on user on None min_package_rank
This commit is contained in:
parent
76675ad76b
commit
95bd1a50d9
@ -75,7 +75,8 @@ def profile(username):
|
||||
all_package_ranks = db.session.query(
|
||||
Package.author_id,
|
||||
func.rank().over(order_by=db.desc(Package.score)) \
|
||||
.label('rank')).order_by(db.asc(text("rank"))).subquery()
|
||||
.label('rank')).order_by(db.asc(text("rank"))) \
|
||||
.filter_by(state=PackageState.APPROVED).subquery()
|
||||
user_package_ranks = db.session.query(all_package_ranks) \
|
||||
.filter_by(author_id=user.id).first()
|
||||
min_package_rank = user_package_ranks[1] if user_package_ranks else None
|
||||
|
@ -218,7 +218,7 @@
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if min_package_rank <= 30 %}
|
||||
{% if min_package_rank is not none and min_package_rank <= 30 %}
|
||||
{% if min_package_rank <= 5 %}
|
||||
{% set badge_color = "gold" %}
|
||||
{% elif min_package_rank <= 10 %}
|
||||
|
Loading…
Reference in New Issue
Block a user