Advertisement
DcruzQ

Untitled

Apr 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. def save(self, *args, **kwargs):
  2.     if self.pk:
  3.       deuda_actual = Enterprise.objects.get(pk=self.pk).ammount_of_doubt
  4.       if self.has_doubt:
  5.         if self.ammount_of_doubt != deuda_actual:
  6.           should_send_email = True
  7.         else:
  8.           should_send_email = self.has_doubt
  9.  
  10.       if should_send_email:  
  11.       #if self.ammount_of_doubt != deuda_actual:
  12.           mensaje = """Hola asdasda """"
  13.          send_mail('Notificacion',mensaje,'misclientes@pescatun.alinet.cu',    [self.email],
  14.          fail_silently=True,)
  15.          #template = get_template("clientes.html").render()  
  16.          #notification.attach(template, "text/html")
  17.          self.emailed = True
  18.    super(Enterprise, self).save(*args, **kwargs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement