removed secrets from the code (reom from chatgpt)
This commit is contained in:
@@ -37,12 +37,7 @@ def edit():
|
||||
abort(403)
|
||||
|
||||
newname = request.form["name"].strip()
|
||||
double = False
|
||||
for d in ListOfItems.query.filter_by(owner_user_id=current_user.id, name=newname).all():
|
||||
if not d.id == ilist_id:
|
||||
# there is a duplicate name
|
||||
double = True
|
||||
if double:
|
||||
if not newname or ListOfItems.name_exists_for_owner(current_user.id, newname, exclude_id=ilist_id):
|
||||
return render_template("lists_edit.html", user=current_user,
|
||||
ilists=current_user.my_owned_lists(with_inactive=True),
|
||||
users=not_current_user(current_user.id),
|
||||
@@ -76,8 +71,7 @@ def edit():
|
||||
# must be a new list
|
||||
newlist = ListOfItems(name=request.form["name"].strip(), owner_user_id=current_user.id)
|
||||
# check if name exists
|
||||
duplicate = ListOfItems.query.filter_by(owner_user_id=current_user.id, name=newlist.name).first()
|
||||
if duplicate:
|
||||
if not newlist.name or ListOfItems.name_exists_for_owner(current_user.id, newlist.name):
|
||||
# there is a duplicate name
|
||||
return render_template("lists_edit.html", user=current_user,
|
||||
ilists=current_user.my_owned_lists(with_inactive=True),
|
||||
|
||||
Reference in New Issue
Block a user