]> git.lizzy.rs Git - cheatdb.git/commitdiff
Add WTFPL warning on new packages
authorrubenwardy <rw@rubenwardy.com>
Mon, 3 Sep 2018 00:39:20 +0000 (01:39 +0100)
committerrubenwardy <rw@rubenwardy.com>
Mon, 3 Sep 2018 00:40:48 +0000 (01:40 +0100)
app/flatpages/help/wtfpl.md [new file with mode: 0644]
app/flatpages/policy_and_guidance.md
app/templates/flatpage.html
app/views/packages/__init__.py

diff --git a/app/flatpages/help/wtfpl.md b/app/flatpages/help/wtfpl.md
new file mode 100644 (file)
index 0000000..418a41e
--- /dev/null
@@ -0,0 +1,42 @@
+title: WTFPL is a terrible license
+no_h1: true
+
+<div id="warning" class="box box_grey alert alert-warning">
+       <span class="icon_message"></span>
+
+       Please reconsider the choice of WTFPL as a license.
+
+       <script src="/static/jquery.min.js"></script>
+       <script>
+               // @author rubenwardy
+               // @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&dn=gpl-3.0.txt GPL-v3-or-Later
+
+               var params = new URLSearchParams(location.search);
+               var r      = params.get("r");
+               if (r)
+                       document.write("<a class='alert_right button' href='" + r + "'>Okay</a>");
+               else
+                       $("#warning").hide();
+       </script>
+</div>
+
+# WTFPL is a terrible license
+
+The use of WTFPL as a license is discouraged for multiple reasons.
+
+* **No Warranty disclaimer:** This could open you up to being sued.<sup>[1]</sup>
+* **Swearing:** This prevents settings like schools from using your content.
+* **Not OSI Approved:** Same as public domain?
+
+The Open Source Initiative chose not to approve the license as an open-source
+license, saying:<sup>[3]</sup>
+
+> It's no different from dedication to the public domain.
+> Author has submitted license approval request – author is free to make public domain dedication.
+> Although he agrees with the recommendation, Mr. Michlmayr notes that public domain doesn't exist in Europe. Recommend: Reject.
+
+## Sources
+
+1. [WTFPL is harmful to software developers](https://cubicspot.blogspot.com/2017/04/wtfpl-is-harmful-to-software-developers.html)
+2. [FSF](https://www.gnu.org/licenses/license-list.en.html)
+3. [OSI](https://opensource.org/minutes20090304)
index df5d3efe3197048c2fc1ffab4b21346ef20b2b37..a66c771ac6db2d7ecf2ca333efbbc6d60a85d654 100644 (file)
@@ -107,8 +107,9 @@ It is recommended that you use a proper license for code with a warranty
 disclaimer, such as the (L)GPL or MIT. You should also use a proper media license
 for media, such as a Creative Commons license.
 
-The use of WTFPL is discouraged as it doesn't contain a valid warranty disclaimer,
-and also includes swearing which dissuades teachers from using your content.
+The use of WTFPL is discouraged as it doesn't contain a [valid warranty disclaimer](https://cubicspot.blogspot.com/2017/04/wtfpl-is-harmful-to-software-developers.html),
+and also includes swearing which prevents settings like schools from using your content.
+[Read more](/help/wtfpl/).
 
 Public domain is not a valid license in many countries, please use CC0 or MIT instead.
 
index 167345de184dfdeb6a3532811bc7cc4c8c5e0ea9..5143f571cda4587bdd4059b9f0aa04031b7ab568 100644 (file)
@@ -5,7 +5,7 @@
 {% endblock %}
 
 {% block content %}
-       <h1>{{ page['title'] }}</h1>
+       {% if not page["no_h1"] %}<h1>{{ page['title'] }}</h1>{% endif %}
 
        {{ page.html | safe }}
 {% endblock %}
index 303ce4797b48f6ec1af07fc9410c0095c40bc78d..7181b5bfce4982f31247cc53f60c9efcffe7e4ac 100644 (file)
@@ -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: