From fa26eac12bb4d8e044669f0038dd61b49704f9d0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-S=C3=A9bastien=20Caux?= <git@jscaux.org>
Date: Fri, 3 Feb 2023 11:51:16 +0100
Subject: [PATCH] Clean out deprecated templates

---
 scipost_django/forums/forms.py                |  3 -
 .../forums/motion_confirm_create.html         | 58 -------------------
 .../forums/templates/forums/motion_form.html  | 27 ---------
 .../templates/forums/post_confirm_create.html | 58 -------------------
 .../forums/templates/forums/post_form.html    | 25 --------
 5 files changed, 171 deletions(-)
 delete mode 100644 scipost_django/forums/templates/forums/motion_confirm_create.html
 delete mode 100644 scipost_django/forums/templates/forums/motion_form.html
 delete mode 100644 scipost_django/forums/templates/forums/post_confirm_create.html
 delete mode 100644 scipost_django/forums/templates/forums/post_form.html

diff --git a/scipost_django/forums/forms.py b/scipost_django/forums/forms.py
index 3b00f074f..c0b23e760 100644
--- a/scipost_django/forums/forms.py
+++ b/scipost_django/forums/forms.py
@@ -178,8 +178,6 @@ class MotionVoteForm(forms.Form):
     )
 
     def clean_motion(self):
-        print(f"in clean_motion: {self.cleaned_data = }")
-        print(f"{self.cleaned_data['motion'] = }")
         if datetime.date.today() > self.cleaned_data["motion"].voting_deadline:
             self.add_error("motion", "Motion is not open for voting anymore")
             return None
@@ -192,7 +190,6 @@ class MotionVoteForm(forms.Form):
 
     def clean(self):
         self.cleaned_data = super().clean()
-        print(f"in clean: {self.cleaned_data = }")
         if (
                 hasattr(self.cleaned_data, "user") and
                 hasattr(self.cleaned_data, "motion") and
diff --git a/scipost_django/forums/templates/forums/motion_confirm_create.html b/scipost_django/forums/templates/forums/motion_confirm_create.html
deleted file mode 100644
index 38ec649a1..000000000
--- a/scipost_django/forums/templates/forums/motion_confirm_create.html
+++ /dev/null
@@ -1,58 +0,0 @@
-{% extends 'forums/base.html' %}
-
-{% load bootstrap %}
-{% load automarkup %}
-
-
-{% block breadcrumb_items %}
-  {{ block.super }}
-  <span class="breadcrumb-item">Confirm Motion creation</span>
-{% endblock %}
-
-{% block pagetitle %}: Motion: confirm creation{% endblock pagetitle %}
-
-{% block content %}
-
-  <div class="row">
-    <div class="col-12">
-      <h3 class="highlight">Preview</h3>
-
-      <div class="card">
-	<div class="card-header">
-	  {{ form.initial.subject }}
-	</div>
-	<div class="card-body">
-	  {% if form.initial.text %}
-	    {% automarkup form.initial.text %}
-	  {% else %}
-	    <span class="text-danger">No text given</span>
-	  {% endif %}
-	</div>
-      </div>
-
-      {% if form.errors %}
-	{% for field in form %}
-	  {% for error in field.errors %}
-	    <div class="alert alert-danger">
-	      <strong>{{ field.name }} - {{ error|escape }}</strong>
-	    </div>
-	  {% endfor %}
-	{% endfor %}
-	{% for error in form.non_field_errors %}
-	  <div class="alert alert-danger">
-	    <strong>{{ error|escape }}</strong>
-	  </div>
-	{% endfor %}
-      {% endif %}
-
-      <form action="" method="post">
-	{% csrf_token %}
-	{{ form|bootstrap }}
-	<input type="submit" value="Confirm Motion creation" class="btn btn-primary">
-	<span class="text-danger">&nbsp;<strong>Not satisfied?</strong> Hit your browser's back button and redraft your Motion</span>
-      </form>
-
-    </div>
-  </div>
-
-{% endblock content %}
diff --git a/scipost_django/forums/templates/forums/motion_form.html b/scipost_django/forums/templates/forums/motion_form.html
deleted file mode 100644
index 42877038a..000000000
--- a/scipost_django/forums/templates/forums/motion_form.html
+++ /dev/null
@@ -1,27 +0,0 @@
-{% extends 'forums/base.html' %}
-
-{% load bootstrap %}
-{% load automarkup %}
-
-
-{% block breadcrumb_items %}
-  {{ block.super }}
-  <span class="breadcrumb-item">{% if form.instance.id %}Update {{ form.instance }}{% else %}New Motion{% endif %}</span>
-{% endblock %}
-
-{% block pagetitle %}: Motion{% endblock pagetitle %}
-
-{% block content %}
-
-  <div class="row">
-    <div class="col-12">
-      <h3 class="highlight">Create a new Motion</h3>
-      <form action="" method="post">
-	{% csrf_token %}
-	{{ form|bootstrap }}
-	<input type="submit" value="Run preview" class="btn btn-primary">
-      </form>
-    </div>
-  </div>
-
-{% endblock content %}
diff --git a/scipost_django/forums/templates/forums/post_confirm_create.html b/scipost_django/forums/templates/forums/post_confirm_create.html
deleted file mode 100644
index d4cc46aa9..000000000
--- a/scipost_django/forums/templates/forums/post_confirm_create.html
+++ /dev/null
@@ -1,58 +0,0 @@
-{% extends 'forums/base.html' %}
-
-{% load bootstrap %}
-{% load automarkup %}
-
-
-{% block breadcrumb_items %}
-  {{ block.super }}
-  <span class="breadcrumb-item">Confirm Post creation</span>
-{% endblock %}
-
-{% block pagetitle %}: Post: confirm creation{% endblock pagetitle %}
-
-{% block content %}
-
-  <div class="row">
-    <div class="col-12">
-      <h3 class="highlight">Preview</h3>
-
-      <div class="card">
-	<div class="card-header">
-	  {{ form.initial.subject }}
-	</div>
-	<div class="card-body">
-	  {% if form.initial.text %}
-	    {% automarkup form.initial.text %}
-	  {% else %}
-	    <span class="text-danger">No text given</span>
-	  {% endif %}
-	</div>
-      </div>
-
-      {% if form.errors %}
-	{% for field in form %}
-	  {% for error in field.errors %}
-	    <div class="alert alert-danger">
-	      <strong>{{ field.name }} - {{ error|escape }}</strong>
-	    </div>
-	  {% endfor %}
-	{% endfor %}
-	{% for error in form.non_field_errors %}
-	  <div class="alert alert-danger">
-	    <strong>{{ error|escape }}</strong>
-	  </div>
-	{% endfor %}
-      {% endif %}
-
-      <form action="" method="post">
-	{% csrf_token %}
-	{{ form|bootstrap }}
-	<input type="submit" value="Confirm Post creation" class="btn btn-primary">
-	<span class="text-danger">&nbsp;<strong>Not satisfied?</strong> Hit your browser's back button and redraft your Post</span>
-      </form>
-
-    </div>
-  </div>
-
-{% endblock content %}
diff --git a/scipost_django/forums/templates/forums/post_form.html b/scipost_django/forums/templates/forums/post_form.html
deleted file mode 100644
index 75d62c012..000000000
--- a/scipost_django/forums/templates/forums/post_form.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{% extends 'forums/base.html' %}
-
-{% load bootstrap %}
-
-{% block breadcrumb_items %}
-  {{ block.super }}
-  <span class="breadcrumb-item">{% if form.instance.id %}Update {{ form.instance }}{% else %}New Post{% endif %}</span>
-{% endblock %}
-
-{% block pagetitle %}: Post{% endblock pagetitle %}
-
-{% block content %}
-
-  <div class="row">
-    <div class="col-12">
-      <h3 class="highlight">Compose a new Post</h3>
-      <form action="" method="post">
-	{% csrf_token %}
-	{{ form|bootstrap }}
-	<input type="submit" value="Run preview" class="btn btn-primary">
-      </form>
-    </div>
-  </div>
-
-{% endblock content %}
-- 
GitLab