mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 09:33:44 +01:00
Prevent users from reviewing their own packages
This commit is contained in:
parent
45877bb3a4
commit
078765fe44
@ -34,6 +34,10 @@ class ReviewForm(FlaskForm):
|
||||
@login_required
|
||||
@is_package_page
|
||||
def review(package):
|
||||
if current_user in package.maintainers:
|
||||
flash("You can't review your own package!", "danger")
|
||||
return redirect(package.getDetailsURL())
|
||||
|
||||
review = PackageReview.query.filter_by(package=package, author=current_user).first()
|
||||
|
||||
form = ReviewForm(formdata=request.form, obj=review)
|
||||
|
Loading…
Reference in New Issue
Block a user