[SUCS Devel] [Git][sucs/accountmanager][master] Handle when there are no users that are expired
Imran Hussain
imranh at sucs.org
Sun Mar 10 18:24:46 GMT 2019
Imran Hussain pushed to branch master at sucs / accountmanager
Commits:
8b380201 by Imran Hussain at 2019-03-10T18:21:24Z
Handle when there are no users that are expired
- - - - -
1 changed file:
- sucsam.py
Changes:
=====================================
sucsam.py
=====================================
@@ -382,11 +382,15 @@ def reminderMenu():
print(str(ass[0]) + " because the DB says: " + str(ass[1]))
reminderMenu()
if option == "2":
- sendReminderEmail(studentsBad)
- sendReminderEmail(societiesBad)
- sendReminderEmail(associatesBad)
+ if len(studentsBad) > 0:
+ sendReminderEmail(studentsBad)
+ if len(societiesBad) > 0:
+ sendReminderEmail(societiesBad)
+ if len(associatesBad) > 0:
+ sendReminderEmail(associatesBad)
if option == "2.1":
- sendReminderEmail(studentsBad)
+ if len(studentsBad) > 0:
+ sendReminderEmail(studentsBad)
if option == "0":
mainMenu()
else:
@@ -425,34 +429,43 @@ def deleteMenu(deleteArray):
print("\x1b[1;31mInvalid user.\x1b[0m")
deleteMenu(deleteArray)
elif option == "3":
- for student in studentsBad:
- print("Adding " + str(student[0]) + " to the list because the DB says: " + str(student[1]))
- deleteArray.append(student[0])
- for soc in societiesBad:
- print("Adding " + str(soc[0]) + " to the list because the DB says: " + str(soc[1]))
- deleteArray.append(soc[0])
- for ass in associatesBad:
- print("Adding " + str(ass[0]) + " to the list because the DB says: " + str(ass[1]))
- deleteArray.append(ass[0])
- deleteMenu(deleteArray)
- elif option == "3.1":
- for student in studentsBad:
- print("Adding " + str(student[0]) + " to the list because the DB says: " + str(student[1]))
- deleteArray.append(student[0])
- elif option == "3.5":
- for student in studentsBad:
- if student[1] == "delete":
+ if len(studentsBad) > 0:
+ for student in studentsBad:
print("Adding " + str(student[0]) + " to the list because the DB says: " + str(student[1]))
deleteArray.append(student[0])
- for soc in societiesBad:
- if soc[1] == "delete":
+ if len(societiesBad) > 0:
+ for soc in societiesBad:
print("Adding " + str(soc[0]) + " to the list because the DB says: " + str(soc[1]))
deleteArray.append(soc[0])
- for ass in associatesBad:
- if ass[1] == "delete":
+ if len(societiesBad) > 0:
+ for ass in associatesBad:
print("Adding " + str(ass[0]) + " to the list because the DB says: " + str(ass[1]))
deleteArray.append(ass[0])
deleteMenu(deleteArray)
+ elif option == "3.1":
+ if len(studentsBad) > 0:
+ for student in studentsBad:
+ print("Adding " + str(student[0]) + " to the list because the DB says: " + str(student[1]))
+ deleteArray.append(student[0])
+ print("No students look like the need deleting.")
+ deleteMenu(deleteArray)
+ elif option == "3.5":
+ if len(studentsBad) > 0:
+ for student in studentsBad:
+ if student[1] == "delete":
+ print("Adding " + str(student[0]) + " to the list because the DB says: " + str(student[1]))
+ deleteArray.append(student[0])
+ if len(societiesBad) > 0:
+ for soc in societiesBad:
+ if soc[1] == "delete":
+ print("Adding " + str(soc[0]) + " to the list because the DB says: " + str(soc[1]))
+ deleteArray.append(soc[0])
+ if len(associatesBad) > 0:
+ for ass in associatesBad:
+ if ass[1] == "delete":
+ print("Adding " + str(ass[0]) + " to the list because the DB says: " + str(ass[1]))
+ deleteArray.append(ass[0])
+ deleteMenu(deleteArray)
elif option == "9":
if debugmode > 0:
print("Debugmode is set. Doing No Deletes.")
View it on GitLab: https://projects.sucs.org/sucs/accountmanager/commit/8b380201461273cc2345a531e89d11682c2977c8
--
View it on GitLab: https://projects.sucs.org/sucs/accountmanager/commit/8b380201461273cc2345a531e89d11682c2977c8
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20190310/63f5a3a8/attachment-0001.html>
More information about the Devel
mailing list