Ejemplo n.º 1
0
def admin_login():
    username = request.form['username']
    password = request.form['password']
    credential = username, password
    result = Login.sign_in(credential)
    token = result[0]
    msg = result[1]
    if token:
        print(msg)
        user = Login.user_detail(username)
        userA.append(username)
        property_list = ViewProperty.view_all()
        sold_property_list = ViewProperty.view_sold()
        request_list = ViewRequest.admin()
        billing_amount = ViewBilling.overview_unpaid()
        return render_template('dashboard.html', user=user, propertycount=len(property_list),
                               propertysold=len(sold_property_list), requestcount=len(request_list),
                               totalbillingamount=billing_amount)
    else:
        print(msg)
        return render_template('login.html')
Ejemplo n.º 2
0
def login(username, password):
    credential = username, password
    message = Login.sign_in(input_credential=credential)
    return message