Skip to content

Commit 275b811

Browse files
author
Hila Manalai
committed
fixed some more todo items
1 parent 2b9ce24 commit 275b811

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

config/config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ roles:
3333

3434
sys:
3535
debug: True
36-
host: "0.0.0.0" #TODO: change this to the user's IP.
36+
host: 0.0.0.0 #TODO: change this to the user's IP.
3737
port: 8080
3838

3939
# Color Codes
@@ -129,8 +129,8 @@ export:
129129
path: "application/reports/"
130130

131131
DEBUG:
132-
#user: "ballz" #admin
132+
user: "heggens" # default user - admin
133+
# user: "ballz" #admin
133134
# user: "hooverk" #systemAdmin
134135
# user: "thakurr" #superUser
135136
# user: "williamsk" #systemUser
136-
user: "heggens" #unnapproved systemUser #TODO: This should be the default user

reset-db.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from application.models import classes
55
from application.config import *
66
from application.models import *
7+
from application.models.usersModel import Users
78
import datetime
89

910
def init_db ():
@@ -24,5 +25,18 @@ def init_db ():
2425
for c in classes:
2526
c.create_table(True)
2627

28+
# Create a Users entry in the database for Scott Heggen as the admin
29+
# The database written to is inventory.sqlite
30+
(Users.create(username="heggens",
31+
first_name="Scott",
32+
last_name="Heggen",
33+
auth_level="admin",
34+
emailadd="[email protected]",
35+
approve=True,
36+
created_date=2022-01-31,
37+
end_date=2025-01-30,
38+
reportto="Idk",
39+
created_by="heggens"))
40+
2741
if __name__ == "__main__":
2842
init_db()

setup.sh

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# exporting these variables into the shell environment before
55
# sourcing this script. If these variables exist before this
66
# script is sourced, then the pre-existing values will be used.
7+
WERKZEUG_VERSION="${WERKZEUG_VERSION:-0.16.0}"
78
FLASK_VERSION="${FLASK_VERSION:-0.12.1}"
89
WTFORMS_VERSION="${WTFORMS_VERSION:-2.1}"
910
FLASK_SESSION_VERSION="${FLASK_SESSION_VERSION:-0.2.3}"
@@ -39,10 +40,10 @@ fi
3940
# Check for correct python version
4041
VERSION=`python2 --version | awk '{print $2}'`
4142
if [ "${VERSION:0:1}" -ne "2" ] || [ "${VERSION:2:1}" -ne "7" ] ; then
42-
echo " You must use Python 2.7. You are using $VERSION "
43+
echo "You must use Python 2.7. You are using $VERSION"
4344
return 1
4445
else
45-
echo -e " You are using Python $VERSION "
46+
echo -e "You are using Python $VERSION"
4647
fi
4748

4849
# Create and activate a clean virtual environment.
@@ -59,6 +60,7 @@ pip install --upgrade pip
5960

6061
# Install specific versions of libraries to avoid
6162
# different behaviors of applications over time.
63+
pip install "werkzeug==$WERKZEUG_VERSION"
6264

6365
pip install "flask==$FLASK_VERSION" #0.12.1
6466
# http://flask.pocoo.org/
@@ -89,13 +91,3 @@ pip install "openpyxl==$OPENPYXL_VERSION" #2.4.5
8991

9092
pip install "unidecode==$UNIDECODE_VERSION" #0.4.20
9193
# https://pypi.python.org/pypi/Unidecode
92-
93-
#TODO: A better approach to dealing with this would be to figure out what causes the
94-
# werkzeug version to be 1.x.x
95-
# I believe it is python version because I get this while uninstalling
96-
97-
# /home/manalaih_ssdt/chemical-inventory/venv/lib/python2.7/site-packages/Werkzeug-1.0.1.dist-info/*
98-
# /home/manalaih_ssdt/chemical-inventory/venv/lib/python2.7/site-packages/werkzeug/*
99-
100-
pip uninstall "werkzeug"
101-
pip install "werkzeug==0.16.0"

0 commit comments

Comments
 (0)