mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 14:02:24 +01:00
Fix minor issues with zipgrep
This commit is contained in:
parent
f137dfa978
commit
64acf3047f
@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
from celery import uuid
|
||||
from flask import Blueprint, render_template, redirect, request
|
||||
from flask import Blueprint, render_template, redirect, request, abort
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, BooleanField, SubmitField
|
||||
from wtforms.validators import InputRequired, Length
|
||||
@ -53,6 +53,9 @@ def zipgrep_search():
|
||||
@bp.route("/zipgrep/<id>/")
|
||||
def view_results(id):
|
||||
result = celery.AsyncResult(id)
|
||||
if result.status == "PENDING":
|
||||
abort(404)
|
||||
|
||||
if result.status != "SUCCESS" or isinstance(result.result, Exception):
|
||||
result_url = url_for("zipgrep.view_results", id=id)
|
||||
return redirect(url_for("tasks.check", id=id, r=result_url))
|
||||
|
@ -10,7 +10,7 @@
|
||||
<h2>{{ query }}</h2>
|
||||
|
||||
<p class="text-muted">
|
||||
Found in {{ matches | count }} packages.
|
||||
Found in {{ matches | count }} package(s).
|
||||
</p>
|
||||
|
||||
<div class="list-group">
|
||||
@ -30,7 +30,7 @@
|
||||
</div>
|
||||
|
||||
<p class="mt-4">
|
||||
{{ match.lines.split("\n") | select | list | count }} matches
|
||||
{{ match.lines.split("\n") | select | list | count }} match(es)
|
||||
</p>
|
||||
|
||||
<a class="mt-4 btn btn-secondary" href="{{ match.package.getDownloadRelease().getDownloadURL() }}">
|
||||
|
Loading…
Reference in New Issue
Block a user