diff options
| author | rubenwardy <rw@rubenwardy.com> | 2018-09-03 01:39:20 +0100 |
|---|---|---|
| committer | rubenwardy <rw@rubenwardy.com> | 2018-09-03 01:40:48 +0100 |
| commit | b8decafd752bc6257d71d1204791727c6a291db0 (patch) | |
| tree | 75d9f6ce4462bbf7b7072f4fb17d4c69baab5f7e /app/views | |
| parent | 5aaee010c17196a4d22900aeb1ee84590ba6c92d (diff) | |
| download | cheatdb-b8decafd752bc6257d71d1204791727c6a291db0.tar.xz | |
Add WTFPL warning on new packages
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/packages/__init__.py | 8 |
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: |
