aboutsummaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-09-03 01:39:20 +0100
committerrubenwardy <rw@rubenwardy.com>2018-09-03 01:40:48 +0100
commitb8decafd752bc6257d71d1204791727c6a291db0 (patch)
tree75d9f6ce4462bbf7b7072f4fb17d4c69baab5f7e /app/views
parent5aaee010c17196a4d22900aeb1ee84590ba6c92d (diff)
downloadcheatdb-b8decafd752bc6257d71d1204791727c6a291db0.tar.xz
Add WTFPL warning on new packages
Diffstat (limited to 'app/views')
-rw-r--r--app/views/packages/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/views/packages/__init__.py b/app/views/packages/__init__.py
index 303ce47..7181b5b 100644
--- a/app/views/packages/__init__.py
+++ b/app/views/packages/__init__.py
@@ -325,11 +325,15 @@ def create_edit_package_page(author=None, name=None):
db.session.commit() # save
+ next_url = package.getDetailsURL()
if wasNew and package.repo is not None:
task = importRepoScreenshot.delay(package.id)
- return redirect(url_for("check_task", id=task.id, r=package.getDetailsURL()))
+ next_url = url_for("check_task", id=task.id, r=next_url)
- return redirect(package.getDetailsURL())
+ if wasNew and ("WTFPL" in package.license.name or "WTFPL" in package.media_license.name):
+ next_url = url_for("flatpage", path="help/wtfpl", r=next_url)
+
+ return redirect(next_url)
package_query = Package.query.filter_by(approved=True, soft_deleted=False)
if package is not None: