new dashboard
This commit is contained in:
@@ -84,12 +84,14 @@ def verify_document(document_id):
|
||||
return redirect(url_for('dashboard'))
|
||||
return redirect(url_for('home'))
|
||||
|
||||
@app.route('/dashboard')
|
||||
@app.route('/dashboard', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def dashboard():
|
||||
if current_user.is_host:
|
||||
listings = Listing.query.filter_by(host_id=current_user.id).all()
|
||||
return render_template('dashboard.html', listings=listings)
|
||||
users = User.query.all()
|
||||
documents = {doc.user_id: doc for doc in Document.query.all()}
|
||||
return render_template('dashboard.html', listings=listings, users=users, documents=documents)
|
||||
return redirect(url_for('home'))
|
||||
|
||||
@app.route('/create-listing', methods=['GET', 'POST'])
|
||||
|
||||
Reference in New Issue
Block a user