def createUser(self, content): print(content) try: user = User(content["name"], content["email"], DB.encrypt(content["pin"])) except KeyError as e: raise BadRequest("I/O error: {0} was not included".format(e)) try: user.clockwidget = content["clockwidget"] except KeyError as e: print("I/O error: {0} was not included".format(e)) try: user.home = content["homeAddress"] except KeyError as e: print("I/O error: {0} was not included".format(e)) try: user.work = content["workAddress"] except KeyError as e: print("I/O error: {0} was not included".format(e)) try: user.twitterwidget = content["twitterwidget"] except KeyError as e: print("I/O error: {0} was not included".format(e)) try: user.calendarwidget = content["calendarwidget"] except KeyError as e: print("I/O error: {0} was not included".format(e)) try: user.mapswidget = content["mapswidget"] except KeyError as e: print("I/O error: {0} was not included".format(e)) try: user.weatherwidget = content["weatherwidget"] except KeyError as e: print("I/O error: {0} was not included".format(e)) return user