From 221f03957e8bd6c953e7d95a1d07aed6663b6887 Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Fri, 15 Feb 2019 12:02:21 -0500 Subject: [PATCH] Creation page for filters --- brutaldon/templates/filters/create.html | 78 +++++++++++++++++++++++++ brutaldon/views.py | 9 +-- 2 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 brutaldon/templates/filters/create.html diff --git a/brutaldon/templates/filters/create.html b/brutaldon/templates/filters/create.html new file mode 100644 index 0000000..c77a68c --- /dev/null +++ b/brutaldon/templates/filters/create.html @@ -0,0 +1,78 @@ +{% extends "base.html" %} +{% load widget_tweaks %} + +{% block content %} + +
+

Create Filter

+ +
+ {% csrf_token %} + +
+ {{ form.non_field_errors }} +
+ +
+ +
+ {% render_field form.phrase class+="input" %} +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+ {% render_field form.expires_in class+="select" %} + + + +
+
+
+ +
+ +
+ +
+
+ + +{% endblock %} diff --git a/brutaldon/views.py b/brutaldon/views.py index 05cef2c..5d7a67a 100644 --- a/brutaldon/views.py +++ b/brutaldon/views.py @@ -979,16 +979,17 @@ def create_filter(request): if form.is_valid(): contexts = [] if form.cleaned_data['context_home']: - contexts += 'home' + contexts.append('home') if form.cleaned_data['context_public']: - contexts += 'public' + contexts.append('public') if form.cleaned_data['context_notes']: - contexts += 'notifications' + contexts.append('notifications') if form.cleaned_data['context_thread']: - contexts += 'thread' + contexts.append('thread') expires = form.cleaned_data['expires_in'] if expires == "": expires = None + set_trace() mastodon.filter_create(form.cleaned_data['phrase'], contexts, whole_word=form.cleaned_data['whole_word'],