.
This commit is contained in:
@@ -11,6 +11,8 @@ from django.conf import settings
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
|
||||
from django.core.mail import send_mail
|
||||
|
||||
|
||||
class Plane(models.Model):
|
||||
plane = models.CharField(max_length=200)
|
||||
@@ -216,6 +218,20 @@ class CidUser(models.Model):
|
||||
def check_passcode(self, passcode) -> bool:
|
||||
return self.passcode == passcode
|
||||
|
||||
def email_details(self):
|
||||
msg = f"""
|
||||
Candidate details for upcomming event {self.group}
|
||||
---------
|
||||
CID: {self.cid}
|
||||
Passcode: {self.passcode}
|
||||
|
||||
|
||||
|
||||
Please note this inbox is not monitored. Direct all enquiries to ...
|
||||
"""
|
||||
|
||||
send_mail("Candidate Details", msg, "test@xkjq.uk", [self.email])
|
||||
|
||||
class CidUserExam(models.Model):
|
||||
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
|
||||
object_id = models.PositiveIntegerField()
|
||||
|
||||
Reference in New Issue
Block a user