def createSection(): name = request.form.get("name") managerIds = [] managers = Backend.getManagers() for manager in managers: managerIds.append(str(manager["ID"])) managersUsed = [] for manager in managerIds: if request.form.get(manager) != None: managersUsed.append(int(manager)) Backend.createSection(name, managersUsed) return '', 204
def adminHomepage(): pageData = { "Name": Backend.getName(current_user.id), "Items": Backend.getItems(), "Sections": list(Backend.getSections()) } managers = Backend.getManagers() sep = [] for manager in managers: sectNames = "" for sect in manager["Sections"]: sectNames += Backend.getSectName(sect) + ", " manager["SectionNames"] = sectNames[:-2] sep.append(manager) pageData["Managers"] = sep return render_template("adminHomepage.html", pageData=pageData)