Add duplicate package check
This commit is contained in:
parent
7bbb480ae2
commit
8d2bb12ad4
@ -168,6 +168,11 @@ def create_edit_package_page(author=None, name=None):
|
|||||||
if request.method == "POST" and form.validate():
|
if request.method == "POST" and form.validate():
|
||||||
wasNew = False
|
wasNew = False
|
||||||
if not package:
|
if not package:
|
||||||
|
package = getPackageByInfo(author.username, form["name"].data)
|
||||||
|
if package is not None:
|
||||||
|
flash("Package already exists!", "error")
|
||||||
|
return redirect(url_for("create_edit_package_page"))
|
||||||
|
|
||||||
package = Package()
|
package = Package()
|
||||||
package.author = author
|
package.author = author
|
||||||
wasNew = True
|
wasNew = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user