21 lines
745 B
Python
21 lines
745 B
Python
from flask import Blueprint, render_template
|
|
from flask.typing import ResponseReturnValue
|
|
from sqlalchemy import func, and_
|
|
|
|
from app.extensions import db
|
|
from app.models.mirrors import Proxy, Origin
|
|
|
|
report = Blueprint("report", __name__)
|
|
|
|
|
|
@report.route("/blocks", methods=['GET'])
|
|
def report_blocks() -> ResponseReturnValue:
|
|
blocked_today = db.session.query(
|
|
Origin.domain_name,
|
|
Origin.description,
|
|
Proxy.added,
|
|
Proxy.deprecated,
|
|
Proxy.deprecation_reason
|
|
).join(Origin, Origin.id == Proxy.origin_id
|
|
).filter(and_(Proxy.deprecated > func.current_date(), Proxy.deprecation_reason.like('block_%'))).all()
|
|
return render_template("report_blocks.html.j2", blocked_today=blocked_today)
|