diff --git a/app/blueprints/homepage/__init__.py b/app/blueprints/homepage/__init__.py index 4e2b9cc0..5049ebc5 100644 --- a/app/blueprints/homepage/__init__.py +++ b/app/blueprints/homepage/__init__.py @@ -18,7 +18,7 @@ from flask import Blueprint, render_template, redirect from sqlalchemy import and_ from app.models import Package, PackageReview, Thread, User, PackageState, db, PackageType, PackageRelease, Tags, Tag, \ - Collection, License + Collection, License, Language bp = Blueprint("homepage", __name__) @@ -77,9 +77,10 @@ def home(): def review_load(query): return query.options( - load_only(PackageReview.id, PackageReview.rating, PackageReview.created_at, raiseload=True), + load_only(PackageReview.id, PackageReview.rating, PackageReview.created_at, PackageReview.language_id, raiseload=True), joinedload(PackageReview.author).load_only(User.username, User.rank, User.email, User.display_name, User.profile_pic, User.is_active, raiseload=True), joinedload(PackageReview.votes), + joinedload(PackageReview.language).load_only(Language.title, raiseload=True), joinedload(PackageReview.thread).load_only(Thread.title, Thread.replies_count, raiseload=True).subqueryload(Thread.first_reply), joinedload(PackageReview.package) .load_only(Package.title, Package.name, raiseload=True) diff --git a/app/blueprints/packages/reviews.py b/app/blueprints/packages/reviews.py index 52464e78..29a52890 100644 --- a/app/blueprints/packages/reviews.py +++ b/app/blueprints/packages/reviews.py @@ -143,8 +143,8 @@ def review(package): url_for("threads.view", id=thread.id), package) if was_new: - post_discord_webhook.delay(thread.author.display_name, - "Reviewed {}: {}".format(package.title, thread.get_view_url(absolute=True)), False) + msg = f"Reviewed {package.title} ({review.language.title}): {thread.get_view_url(absolute=True)}" + post_discord_webhook.delay(thread.author.display_name, msg, False) db.session.commit() diff --git a/app/templates/macros/reviews.html b/app/templates/macros/reviews.html index 586af09e..1dc334b6 100644 --- a/app/templates/macros/reviews.html +++ b/app/templates/macros/reviews.html @@ -63,6 +63,11 @@ {% endif %} + {% if review.language %} + + {{ review.language.title }} + + {% endif %}

{{ review.thread.title }}