Skip to content

Commit

Permalink
Corrected import and templates paths from contactform to dbform which…
Browse files Browse the repository at this point in the history
… appeared to be legacy statements.

Signed-off-by: Patrick Lauber <patrick.lauber@divio.ch>
  • Loading branch information
agentk authored and Patrick Lauber committed Aug 20, 2009
1 parent 7d07cd4 commit aa858e3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dbforms/cms_plugins.py
Expand Up @@ -4,7 +4,7 @@


from cms.plugin_pool import plugin_pool from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase from cms.plugin_base import CMSPluginBase
from contactform.models import ContactFormIntermediate, ContactFormSubmission from dbforms.models import ContactFormIntermediate, FormSubmission
from django.template.context import Context from django.template.context import Context
from django.template.defaultfilters import slugify, yesno from django.template.defaultfilters import slugify, yesno
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
Expand All @@ -17,8 +17,8 @@ class ContactFormPlugin(CMSPluginBase):
model = ContactFormIntermediate model = ContactFormIntermediate
name = _("Contact Form") name = _("Contact Form")
placeholders = ("content",) placeholders = ("content",)
render_template = "contactform/form.html" render_template = "dbform/form.html"
form_template = "contactform/plugin_form.html" form_template = "dbform/plugin_form.html"


def render(self, context, instance, placeholder): def render(self, context, instance, placeholder):
request = context['request'] request = context['request']
Expand Down Expand Up @@ -72,7 +72,7 @@ def render(self, context, instance, placeholder):
'sender_ip': request.META['REMOTE_ADDR'], 'sender_ip': request.META['REMOTE_ADDR'],
'form_url': request.build_absolute_uri(), 'form_url': request.build_absolute_uri(),
}, autoescape=False) }, autoescape=False)
text_template = loader.get_template('contactform/form_email.txt') text_template = loader.get_template('dbform/form_email.txt')
text_content = text_template.render(message_context) text_content = text_template.render(message_context)
recipient_list = [recipient['email'] for recipient in contact_form.recipients.values('email')] recipient_list = [recipient['email'] for recipient in contact_form.recipients.values('email')]
bcc = [] bcc = []
Expand All @@ -89,7 +89,7 @@ def render(self, context, instance, placeholder):
'success': mark_safe(contact_form.success_message.strip() or _("Your request has been submitted. We will process it as soon as possible.")), 'success': mark_safe(contact_form.success_message.strip() or _("Your request has been submitted. We will process it as soon as possible.")),
}) })
# save message to db for later reference # save message to db for later reference
submission = ContactFormSubmission( submission = FormSubmission(
form=contact_form, form=contact_form,
sender_ip=request.META['REMOTE_ADDR'], sender_ip=request.META['REMOTE_ADDR'],
form_url=request.build_absolute_uri(), form_url=request.build_absolute_uri(),
Expand All @@ -104,4 +104,4 @@ def render(self, context, instance, placeholder):
}) })
return my_context return my_context


plugin_pool.register_plugin(ContactFormPlugin) plugin_pool.register_plugin(ContactFormPlugin)

0 comments on commit aa858e3

Please sign in to comment.