diff --git a/app.py b/app.py
index 0728bb0..feb4c3b 100644
--- a/app.py
+++ b/app.py
@@ -14,6 +14,7 @@
from flask_wtf.csrf import CSRFProtect
import math
import nh3
+import vidzyconfig
inproduction = False
productionpath = os.path.expanduser('~/mysite')
@@ -792,6 +793,10 @@ def upload_file():
if not "username" in session:
return ""
+ if "ALLOW_UPLOADS" in vidzyconfig.config:
+ if vidzyconfig.config["ALLOW_UPLOADS"] == False:
+ return "This instance does not allow uploading videos"
+
if request.method == 'POST':
# check if the post request has the file part
if 'file' not in request.files:
diff --git a/settings.py b/settings.py
index 5e6fad6..17c6ec5 100644
--- a/settings.py
+++ b/settings.py
@@ -19,3 +19,5 @@
MINIFY_HTML = os.environ.get("MINIFY_HTML")
HOST = os.environ.get("HOST")
+
+ALLOW_UPLOADS = os.environ.get("ALLOW_UPLOADS")
\ No newline at end of file
diff --git a/templates/admin_panel.html b/templates/admin_panel.html
index 8bcd350..9b58637 100644
--- a/templates/admin_panel.html
+++ b/templates/admin_panel.html
@@ -162,7 +162,6 @@
Shorts (last 50)
new Chart(document.getElementById("videosChart"), {
type: 'bar',
data: {
- //labels: ["2024-08-16", "2024-08-17", "2024-08-18", "2024-08-19", "2024-08-20"],
labels: [{% for key, value in videos_on_date_uploaded.items() %}"{{key}}",{% endfor %}],
datasets: [
{
@@ -189,53 +188,6 @@ Shorts (last 50)
}
}
});
-
-/*
-// Line chart
-new Chart(document.getElementById("videosChart"), {
- type: 'line',
- data: {
- labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
- datasets: [{
- data: [1,2,4],
- label: "Alberta",
- borderColor: "#3e95cd",
- fill: false
- }, {
- data: [1,2,5],
- label: "BC",
- borderColor: "#8e5ea2",
- fill: false
- }, {
- data: [1,2,8],
- label: "Manitoba",
- borderColor: "#3cba9f",
- fill: false
- }, {
- data: [1,2,10],
- label: "New Brunswick",
- borderColor: "#e8c3b9",
- fill: false
- }, {
- data: [1,2,16],
- label: "NL",
- borderColor: "#c45850",
- fill: false
- }
- ]
- },
- options: {
- title: {
- display: true,
- text: 'Positive Cases of COVID in provinces of Canada'
- },
- hover: {
- mode: 'index',
- intersect: true
- },
- }
-});
-*/