Example #1
0
def update_user(hsh):
    try:
        _json = request.args

        _title = _json['title']
        _description = _json['description']
        _due = _json['due']
        # validate the received values
        if _title and _description and _due and request.method == 'POST':

            task = Tasks.Task(_title, _description, _due)
            new_hash = db.update_task(task, hsh)

            resp = jsonify({
                'message': 'User updated successfully!',
                'hash': new_hash,
            })
            resp.status_code = 200
            return resp
        else:
            return not_found()
    except Exception as e:
        print(e)
Example #2
0
import Authenticate
import Tasks

auth = Authenticate.Authentication()
db = Authenticate.Database()
task = Tasks.Task()


class AskingUser:
    email = ""
    password = ""

    personal_details = {
        "Name": "",
        "Age": "",
        "Gender": "",
        "Date_of_birth"
        "Something_about_yourself": "",
    }

    def __init__(self):
        print("Hello user ..!")

    def user_choice(self):
        choice = input("What would you like to do ? \n 1.Login ? \n 2.Register \n")
        if int(choice) == 1:
            self.ask_user()
            self.login()
            self.add_task_details()
        elif int(choice) == 2:
            self.ask_user()