Commit 8b380201 authored by Imran Hussain's avatar Imran Hussain
Browse files

Handle when there are no users that are expired

parent 13acae44
......@@ -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.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment