summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2020-05-27 01:04:37 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2020-05-27 01:04:37 +0100
commit73637ba53d957b19e05eb16e5636d20374353dfe (patch)
treee3395f1d3d7d4b3b8534badbb06aa9b910a7cc6f /databaseReset.py
parentc9657aeb8c6aed01db7a844883a37dce4afae861 (diff)
downloadtroggle-73637ba53d957b19e05eb16e5636d20374353dfe.tar.gz
troggle-73637ba53d957b19e05eb16e5636d20374353dfe.tar.bz2
troggle-73637ba53d957b19e05eb16e5636d20374353dfe.zip
Clean install with python3
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/databaseReset.py b/databaseReset.py
index bfed32a..e775eb7 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -6,10 +6,6 @@ import timeit
import json
import settings
-if os.geteuid() == 0:
- print("This script should be run as expo not root - quitting")
- exit()
-
os.environ['PYTHONPATH'] = settings.PYTHON_PATH
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
@@ -27,6 +23,11 @@ import troggle.logbooksdump
# NOTE databaseReset.py is *imported* by views_other.py as it is used in the control panel
# presented there.
+if os.geteuid() == 0:
+ # This protects the server from having the wrong file permissions written on logs and caches
+ print("This script should be run as expo not root - quitting")
+ exit()
+
expouser=settings.EXPOUSER
expouserpass=settings.EXPOUSERPASS
expouseremail=settings.EXPOUSER_EMAIL