| |
@@ -106,12 +106,20 @@
|
| |
send_html_mail(subject, body_txt, body_html, self.recipient_email)
|
| |
self.save()
|
| |
|
| |
+ def __str__(self):
|
| |
+ """String for representing the Message object (in Admin site etc.)."""
|
| |
+ return self.identifier
|
| |
+
|
| |
|
| |
class BlacklistedEmail(TimeStampedModel):
|
| |
email = models.EmailField()
|
| |
stripped_email = models.CharField(max_length=255)
|
| |
confirmation_ip = models.GenericIPAddressField()
|
| |
|
| |
+ def __str__(self):
|
| |
+ """String for representing the BlacklistedEmail object (in Admin site etc.)."""
|
| |
+ return self.email
|
| |
+
|
| |
|
| |
def strip_email(email):
|
| |
return re.sub('[^@\w]', '', re.sub('\+\w+', '', email.lower()))
|
| |
This change adds _str__() to return a human-readable string for the Message and BlacklistedEmail models in models.py.
With this change individual entries for each both models are easily identified in the Django Admin.
The Message entry will return the the message identifier.
The BlacklistedEmail will return the email.
This change addresses the second point in #157.