~cedric/newspipe

1

[PATCH] hide registration button, fix #11

Details
Message ID
<CABSMGamYFSOAXrAbpf7rCzAm-OLb8vQxo2r_UdvP5xiym9s=Og@mail.gmail.com>
DKIM signature
missing
Download raw message
From: "B. Stack" <bgstack15@gmail.com>

---
 newspipe/templates/login.
html      | 2 +-
 newspipe/web/views/session_mgmt.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/newspipe/templates/login.html b/newspipe/templates/login.html
index 5d936d1..b995230 100644
--- a/newspipe/templates/login.html
+++ b/newspipe/templates/login.html
@@ -19,7 +19,7 @@
                     <div class="alert alert-warning" role="alert">{{
message }}</div>
                 {% endfor %}
                 {{ form.submit(class_="btn btn-primary") }}
-                <a href="/signup" class="btn btn-info">{{ _('Sign up') }}</a>
+                {% if self_registration %}<a href="/signup"
class="btn btn-info">{{ _('Sign up') }}</a>{% endif %}
             </form>
         </div>
     </div>
diff --git a/newspipe/web/views/session_mgmt.py
b/newspipe/web/views/session_mgmt.py
index 0e8329e..0154503 100644
--- a/newspipe/web/views/session_mgmt.py
+++ b/newspipe/web/views/session_mgmt.py
@@ -84,7 +84,7 @@ def login():
     if request.method == "POST" and form.validate():  # fixes an
issue in flask-wtf
         login_user_bundle(form.user)
         return form.redirect("home")
-    return render_template("login.html", form=form)
+    return render_template("login.html", form=form,
self_registration=application.config["SELF_REGISTRATION"])


 @current_app.route("/logout")
--
1.8.3.1
Cédric Bonhomme <cedric.bonhomme@circl.lu>
Details
Message ID
<12240270.O9o76ZdvQC@debian>
In-Reply-To
<CABSMGamYFSOAXrAbpf7rCzAm-OLb8vQxo2r_UdvP5xiym9s=Og@mail.gmail.com> (view parent)
DKIM signature
missing
Download raw message
Thank you very much for your contribution !

Cédric
Reply to thread Export thread (mbox)