Commits

Guilherme Gondim committed 1436e44

Improve BaseContactView initialization

Comments (0)

Files changed (1)

 
 
 class BaseContactView(FormView):
-    body_template = None
-    subject_template = None
-    recipient_list = None
+
+    def __init__(self, success_url=None, body_template=None, subject_template=None, recipient_list=None):
+        self.success_url = success_url
+        self.body_template = body_template
+        self.subject_template = subject_template
+        self.recipient_list = recipient_list
 
     def get_success_url(self):
+        if self.success_url:
+            return self.success_url
         return reverse('contato-sent')
 
     def get_body_template(self):