|
@@ -76,6 +76,15 @@ def profile():
|
|
|
def create():
|
|
def create():
|
|
|
form = CAForm()
|
|
form = CAForm()
|
|
|
|
|
|
|
|
|
|
+ owned_art = Art.query.filter_by(owner=current_user.id).all()
|
|
|
|
|
+ listed_art = List.query.filter_by(seller=current_user.id).all()
|
|
|
|
|
+ available_art = list()
|
|
|
|
|
+
|
|
|
|
|
+ # to remove art that is already listed
|
|
|
|
|
+ available_art = [art for art in owned_art if art.filehash not in listed_art]
|
|
|
|
|
+ print(listed_art)
|
|
|
|
|
+ print(available_art)
|
|
|
|
|
+
|
|
|
# check POST req
|
|
# check POST req
|
|
|
if form.validate_on_submit():
|
|
if form.validate_on_submit():
|
|
|
new_art = form.upload.data
|
|
new_art = form.upload.data
|
|
@@ -91,8 +100,9 @@ def create():
|
|
|
designated_fn = cf.sanitize(new_art.filename)
|
|
designated_fn = cf.sanitize(new_art.filename)
|
|
|
new_art.save(f'{cf.UPLOAD_FOLDER}/{designated_fn}')
|
|
new_art.save(f'{cf.UPLOAD_FOLDER}/{designated_fn}')
|
|
|
dispatch.mint(designated_fn, art_name, art_desc, min_price, buyout_price, close_date)
|
|
dispatch.mint(designated_fn, art_name, art_desc, min_price, buyout_price, close_date)
|
|
|
|
|
+ # elif here
|
|
|
|
|
|
|
|
- return render_template('create_art.html', user = current_user, form = form)
|
|
|
|
|
|
|
+ return render_template('create_art.html', user = current_user, form = form, av_art = available_art)
|
|
|
|
|
|
|
|
# Pop Ups
|
|
# Pop Ups
|
|
|
@dashboards.route('/modal_home')
|
|
@dashboards.route('/modal_home')
|