Skip to content

Commit 8c0bc8e

Browse files
committed
Changed zcm and zorg workflows. See CHANGELOG.md for more details.
1 parent 4dabe07 commit 8c0bc8e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Changelog.md
22

3+
v.02 - Edited zcm and zorg workflows. When adding the ZCM the system will automatically refresh the list of ZVMs and the list of ZORGs. When importing ZORGS for the first time, emails will be disabled, but once you add an email address it will auto-enable emails for that zorg
34
v0.1 - added change log file

main.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def action ():
127127
name=request.values.get("name")
128128
zorgid=request.values.get("zorgid")
129129
email=request.values.get("email")
130-
zorgdb.insert({ "name":name, "zorgid":zorgid, "email":email })
130+
zorgdb.insert({ "name":name, "zorgid":zorgid, "email":email, 'email_enabled': True })
131131
return redirect("/list")
132132

133133
@app.route("/zcmadd", methods=['POST'])
@@ -139,6 +139,8 @@ def zcmadd ():
139139
username=request.values.get("username")
140140
password=request.values.get("password")
141141
configdb.insert({ "type": "zcm", "hostname": hostname, "port": port, "username": username, "password": password })
142+
importzvms()
143+
importzorg()
142144
return redirect("/config")
143145

144146
@app.route("/smtpadd", methods=['POST'])
@@ -210,7 +212,7 @@ def action3 ():
210212
id=request.values.get("id")
211213
email=request.values.get("email")
212214
id=request.values.get("_id")
213-
zorgdb.update({"_id":ObjectId(id)}, {'$set':{ "name":name, "id":id, "email":email }})
215+
zorgdb.update({"_id":ObjectId(id)}, {'$set':{ "name":name, "id":id, "email":email, 'email_enabled': True }})
214216
return redirect("/")
215217

216218
@app.route("/action4", methods=['POST'])
@@ -223,6 +225,8 @@ def action4 ():
223225
port=request.values.get("port")
224226
id=request.values.get("_id")
225227
configdb.update({"_id":ObjectId(id)}, {'$set':{ "hostname": hostname, "port": port, "username": username, "password": password }})
228+
importzvms()
229+
importzorg()
226230
return redirect("/config")
227231

228232
@app.route("/action5", methods=['POST'])
@@ -376,7 +380,7 @@ def importzorg ():
376380

377381
if zorgdb.find({"zorgid": zorg['ZorgIdentifier']}).count() < 1:
378382
logger.debug("Zorg added to DB - " + zorg['ZorgIdentifier'] + " - " + zorg['Name'])
379-
zorgdb.insert({ "zorgid": zorg['ZorgIdentifier'], "name": zorg['Name'], 'email_enabled': True })
383+
zorgdb.insert({ "zorgid": zorg['ZorgIdentifier'], "name": zorg['Name'], 'email_enabled': False })
380384
else:
381385
logger.debug("Zorg already exists in DB - " + zorg['ZorgIdentifier'] + " - " + zorg['Name'])
382386

0 commit comments

Comments
 (0)