Esempio n. 1
0
 def save(self, *args, **kwargs):
     # normalize text so it's easy to work with
     if not self.to_lines:
         self.to_lines = ''
     self.to_lines = normalize_newlines(self.to_lines.rstrip())
     self.from_lines = normalize_newlines(self.from_lines.rstrip())
     self.subject = normalize_newlines(self.subject.rstrip())
     self.memo_text = normalize_newlines(self.memo_text.rstrip())
     self.memo_text = many_newlines.sub('\n\n', self.memo_text)
     super(Memo, self).save(*args, **kwargs)
Esempio n. 2
0
 def save(self, *args, **kwargs):
     # normalize text so it's easy to work with
     if not self.to_lines:
         self.to_lines = ''
     self.to_lines = normalize_newlines(self.to_lines.rstrip())
     self.from_lines = normalize_newlines(self.from_lines.rstrip())
     self.subject = normalize_newlines(self.subject.rstrip())
     self.memo_text = normalize_newlines(self.memo_text.rstrip())
     self.memo_text = many_newlines.sub('\n\n', self.memo_text)
     super(Memo, self).save(*args, **kwargs)