From da151b718f6c6658ec9aeca1f6e7f0d17f7c7c12 Mon Sep 17 00:00:00 2001 From: gzbender Date: Mon, 1 Oct 2018 17:05:49 +0500 Subject: [PATCH] LIL-503 --- .../management/commands/send_certificates.py | 3 ++- apps/notification/models.py | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 apps/notification/models.py diff --git a/apps/notification/management/commands/send_certificates.py b/apps/notification/management/commands/send_certificates.py index 639cb21e..343b451b 100644 --- a/apps/notification/management/commands/send_certificates.py +++ b/apps/notification/management/commands/send_certificates.py @@ -1,4 +1,5 @@ from django.core.management.base import BaseCommand +from email.mime.image import MIMEImage from apps.notification.utils import send_email @@ -7,4 +8,4 @@ class Command(BaseCommand): help = 'Send certificates at the end of subscription' def handle(self, *args, **options): - pass + image = MIMEImage(cms.image.open().read()) diff --git a/apps/notification/models.py b/apps/notification/models.py new file mode 100644 index 00000000..6e4e18f5 --- /dev/null +++ b/apps/notification/models.py @@ -0,0 +1,10 @@ +from django.db import models +from django.contrib.auth import get_user_model + + +User = get_user_model() + +class UserNotification(models.Model): + user = models.ForeignKey(User, on_delete=models.CASCADE) + certificate_number = models.SmallIntegerField(blank=True, null=True) + certificate_last_email = models.DateTimeField(blank=True, null=True)