diff --git a/.well-known/service-worker.js b/.well-known/service-worker.js deleted file mode 100644 index b4b36265ff..0000000000 --- a/.well-known/service-worker.js +++ /dev/null @@ -1 +0,0 @@ -importScripts(); \ No newline at end of file diff --git a/files/helpers/lazy.py b/files/helpers/lazy.py index 3e2a699eaa..e91cf2b639 100644 --- a/files/helpers/lazy.py +++ b/files/helpers/lazy.py @@ -8,11 +8,9 @@ def lazy(f): o = args[0] - if "_lazy" not in o.__dict__: - o.__dict__["_lazy"] = {} + if "_lazy" not in o.__dict__: o.__dict__["_lazy"] = {} - if f.__name__ not in o.__dict__["_lazy"]: - o.__dict__["_lazy"][f.__name__] = f(*args, **kwargs) + if f.__name__ not in o.__dict__["_lazy"]: o.__dict__["_lazy"][f.__name__] = f(*args, **kwargs) return o.__dict__["_lazy"][f.__name__] diff --git a/files/routes/static.py b/files/routes/static.py index 5d0769958a..c0dfe3b1ca 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -132,10 +132,6 @@ def log_item(id, v): action=action ) -@app.route("/sex") -def index(): - return render_template("index.html", **{"greeting": "Hello from Flask!"}) - @app.get("/assets/favicon.ico") def favicon(): return send_file(f"./assets/images/{site_name}/icon.webp") @@ -248,8 +244,7 @@ def googleplayapp(): @app.route("/service-worker.js") def serviceworker(): - return redirect("https://js.pusher.com/beams/service-worker.js") - + with open("files/assets/js/service-worker.js", "r") as f: return Response(f.read(), mimetype='application/javascript') @app.get("/settings/security") @auth_required diff --git a/files/routes/votes.py b/files/routes/votes.py index 17cd71e97d..acff97e3e6 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -156,5 +156,5 @@ def api_vote_comment(comment_id, new, v): comment.downvotes = g.db.query(CommentVote).options(lazyload('*')).filter_by(comment_id=comment.id, vote_type=-1).count() g.db.add(comment) g.db.commit() - except: g.db.rolleback() + except: g.db.rollback() return "", 204 \ No newline at end of file diff --git a/files/templates/submission.html b/files/templates/submission.html index 2e01e775e6..975c4e0d9a 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -209,8 +209,8 @@ {% if p.award_count("stars") %} - {% set minbugs = 30*p.award_count("stars") if p.award_count("stars") <= 5 else 100 %} - {% set maxbugs = 60*p.award_count("stars") if p.award_count("stars") <= 5 else 200 %} + {% set minbugs = 10*p.award_count("stars") if p.award_count("stars") <= 5 else 50 %} + {% set maxbugs = 20*p.award_count("stars") if p.award_count("stars") <= 5 else 100 %}