@@ -22,44 +22,46 @@ def get_current_site():
22
22
except :
23
23
current_site = 'example.com'
24
24
return _ ('Contact form message from {}' ).format (current_site )
25
+
26
+
25
27
@python_2_unicode_compatible
26
28
class ContactPlus (CMSPlugin ):
27
- title = models .CharField (_ ('Title' ),
28
- null = True ,
29
- blank = True ,
30
- max_length = 100 ,
29
+ title = models .CharField (_ ('Title' ),
30
+ null = True ,
31
+ blank = True ,
32
+ max_length = 100 ,
31
33
help_text = _ ("Title for the Contact Form." ))
32
34
email_subject = models .CharField (
33
- max_length = 256 ,
35
+ max_length = 256 ,
34
36
verbose_name = _ ("Email subject" ),
35
37
default = get_current_site )
36
- recipient_email = models .EmailField (_ ("Email of recipients" ),
38
+ recipient_email = models .EmailField (_ ("Email of recipients" ),
37
39
default = DEFAULT_FROM_EMAIL_ADDRESS ,
38
40
max_length = 254 )
39
- collect_records = models .BooleanField (_ ('Collect Records' ),
40
- default = True ,
41
+ collect_records = models .BooleanField (_ ('Collect Records' ),
42
+ default = True ,
41
43
help_text = _ ("If active, all records for this Form will be stored in the Database." ))
42
44
thanks = models .TextField (_ ('Message displayed after submitting the contact form.' ))
43
45
submit_button_text = models .CharField (_ ('Text for the Submit button.' ),
44
- blank = True ,
46
+ blank = True ,
45
47
max_length = 30 )
46
48
template = models .CharField (
47
49
max_length = 255 ,
48
50
choices = local_settings .CMSPLUGIN_CONTACT_PLUS_TEMPLATES ,
49
51
default = 'cmsplugin_contact_plus/contact.html' ,
50
52
editable = len (local_settings .CMSPLUGIN_CONTACT_PLUS_TEMPLATES ) > 1 )
51
-
53
+
52
54
class Meta :
53
55
verbose_name = "Contact Plus Form"
54
56
verbose_name_plural = "Contact Plus Forms"
55
-
57
+
56
58
def copy_relations (self , oldinstance ):
57
59
for extrafield in ExtraField .objects .filter (form__pk = oldinstance .pk ):
58
60
extrafield .pk = None
59
61
extrafield .save ()
60
62
self .extrafield_set .add (
61
63
extrafield )
62
-
64
+
63
65
def __str__ (self ):
64
66
if self .title :
65
67
return self .title
@@ -140,6 +142,5 @@ def is_processed(self):
140
142
return False
141
143
142
144
def __str__ (self ):
143
- return _ (u"Record for %(contact)s recorded on %(date)s" ) % {'contact' :self .contact_form ,
145
+ return _ (u"Record for %(contact)s recorded on %(date)s" ) % {'contact' :self .contact_form ,
144
146
'date' : self .date_of_entry .strftime ('%d. %b %Y' ) }
145
-
0 commit comments