user dashboard
This commit is contained in:
@@ -122,7 +122,11 @@ def dashboard():
|
||||
documents = {doc.user_id: doc for doc in Document.query.all()}
|
||||
bookings = Booking.query.join(Listing).filter(Listing.host_id == current_user.id).all()
|
||||
return render_template('dashboard.html', listings=listings, users=users, documents=documents, bookings=bookings)
|
||||
return redirect(url_for('home'))
|
||||
else:
|
||||
bookings = Booking.query.filter_by(user_id=current_user.id).join(Listing).add_columns(
|
||||
Listing.title, Listing.location, Listing.property_type, Booking.check_in, Booking.check_out
|
||||
).all()
|
||||
return render_template('user.html', bookings=bookings)
|
||||
|
||||
@app.route('/create-listing', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
|
||||
Reference in New Issue
Block a user