mirror of
https://github.com/aljazceru/CTFd.git
synced 2025-12-19 06:54:20 +01:00
Don't insert or check Tracking on static files or custom CSS (#976)
* No longer incur Tracking hits on theme files or custom CSS
This commit is contained in:
@@ -154,7 +154,9 @@ def init_request_processors(app):
|
|||||||
|
|
||||||
@app.before_request
|
@app.before_request
|
||||||
def tracker():
|
def tracker():
|
||||||
# TODO: This function shouldn't cause a DB hit for lookups if possible
|
if request.endpoint in ('views.themes', 'views.custom_css'):
|
||||||
|
return
|
||||||
|
|
||||||
if authed():
|
if authed():
|
||||||
track = Tracking.query.filter_by(ip=get_ip(), user_id=session['id']).first()
|
track = Tracking.query.filter_by(ip=get_ip(), user_id=session['id']).first()
|
||||||
if not track:
|
if not track:
|
||||||
|
|||||||
Reference in New Issue
Block a user