kopia lustrzana https://github.com/wagtail/wagtail
				
				
				
			Change method name to AbstractEmailForm.send_mail
Also contails release notes for #2926pull/2812/head
							rodzic
							
								
									2403be5938
								
							
						
					
					
						commit
						b37e8ccbcf
					
				|  | @ -5,6 +5,7 @@ Changelog | |||
| ~~~~~~~~~~~~~~~~ | ||||
| 
 | ||||
|  * The Wagtail version number can now be obtained as a tuple using `from wagtail import VERSION` (Tim Heap) | ||||
|  * ``send_mail`` logic has been moved from ``AbstractEmailForm.process_form_submission`` into ``AbstractEmailForm.send_mail``. Now it's easier to override this logic (Tim Leguijt) | ||||
|  * Fix: Migrations for wagtailcore and project template are now reversible (Benjamin Bach) | ||||
|  * Fix: The default image format label text ('Full width', 'Left-aligned', 'Right-aligned') is now localised (Mikalai Radchuk) | ||||
| 
 | ||||
|  |  | |||
|  | @ -161,6 +161,7 @@ Contributors | |||
| * Fábio Macêdo Mendes | ||||
| * Eraldo Energy | ||||
| * Jesse Legg | ||||
| * Tim Leguijt | ||||
| 
 | ||||
| Translators | ||||
| =========== | ||||
|  |  | |||
|  | @ -15,6 +15,7 @@ Minor features | |||
| ~~~~~~~~~~~~~~ | ||||
| 
 | ||||
| * The Wagtail version number can now be obtained as a tuple using ``from wagtail import VERSION`` (Tim Heap) | ||||
| * ``send_mail`` logic has been moved from ``AbstractEmailForm.process_form_submission`` into ``AbstractEmailForm.send_mail``. Now it's easier to override this logic (Tim Leguijt) | ||||
| 
 | ||||
| 
 | ||||
| Bug fixes | ||||
|  |  | |||
|  | @ -218,10 +218,10 @@ class AbstractEmailForm(AbstractForm): | |||
|     def process_form_submission(self, form): | ||||
|         submission = super(AbstractEmailForm, self).process_form_submission(form) | ||||
|         if self.to_address: | ||||
|             self.send_form_mail(form) | ||||
|             self.send_mail(form) | ||||
|         return submission | ||||
| 
 | ||||
|     def send_form_mail(self, form): | ||||
|     def send_mail(self, form): | ||||
|         addresses = [x.strip() for x in self.to_address.split(',')] | ||||
|         content = '\n'.join([x[1].label + ': ' + text_type(form.data.get(x[0])) for x in form.fields.items()]) | ||||
|         send_mail(self.subject, content, addresses, self.from_address,) | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Mikalai Radchuk
						Mikalai Radchuk