summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrathamesh2024-01-08 12:19:57 +0530
committerPrathamesh2024-01-08 12:19:57 +0530
commit33d434e5b8fc7e8b23bef78bb9e3f0739ee9e222 (patch)
treeb01e48b0b2ddde2023ce007739f7f454da6b4b67
parent2a05a7d86f4fd744a32f1f6c4d5575323067d69e (diff)
downloadcertificate-generation-33d434e5b8fc7e8b23bef78bb9e3f0739ee9e222.tar.gz
certificate-generation-33d434e5b8fc7e8b23bef78bb9e3f0739ee9e222.tar.bz2
certificate-generation-33d434e5b8fc7e8b23bef78bb9e3f0739ee9e222.zip
Make delete option available for the admin
-rw-r--r--website/cgen/models.py8
-rw-r--r--website/cgen/templates/base.html4
-rw-r--r--website/cgen/templates/index.html4
3 files changed, 8 insertions, 8 deletions
diff --git a/website/cgen/models.py b/website/cgen/models.py
index e367ae3..0387a29 100644
--- a/website/cgen/models.py
+++ b/website/cgen/models.py
@@ -45,7 +45,7 @@ class Event(models.Model):
is_published = models.BooleanField(default=False)
# One who creates the event (organiser)
- creator = models.ForeignKey(User, null=True, on_delete=models.PROTECT)
+ creator = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
def __str__(self):
@@ -58,7 +58,7 @@ class Certificate(models.Model):
"""
# Event to which the certificate belongs
- event = models.ForeignKey(Event, on_delete=models.PROTECT)
+ event = models.ForeignKey(Event, on_delete=models.CASCADE)
# Type of certificate
description = models.TextField()
@@ -87,7 +87,7 @@ class Participant(models.Model):
email = models.EmailField(max_length=1000)
- certificate = models.ForeignKey('Certificate', on_delete=models.PROTECT)
+ certificate = models.ForeignKey('Certificate', on_delete=models.CASCADE)
details = models.TextField()
@@ -107,7 +107,7 @@ class CertificateManager(models.Model):
null=True, blank=True, default=None,
)
- participant = models.ForeignKey(Participant, on_delete=models.PROTECT)
+ participant = models.ForeignKey(Participant, on_delete=models.CASCADE)
is_created = models.BooleanField(default=False)
diff --git a/website/cgen/templates/base.html b/website/cgen/templates/base.html
index edb4e75..4e6bd11 100644
--- a/website/cgen/templates/base.html
+++ b/website/cgen/templates/base.html
@@ -67,8 +67,8 @@
<main>
- <section class="py-5 text-center container" style="max-height:150px;">
- <div class="row py-lg-5" style="padding-top:1rem; padding-bottom:1rem;">
+ <section class="py-5 text-center container">
+ <div class="row py-lg-5">
<div class="col-lg-6 col-md-8 mx-auto">
<h1 class="fw-light">{% block header %} {% endblock %}</h1>
<p class="lead text-muted">{% block header_content %} {% endblock %}</p>
diff --git a/website/cgen/templates/index.html b/website/cgen/templates/index.html
index 134f021..5ace6a7 100644
--- a/website/cgen/templates/index.html
+++ b/website/cgen/templates/index.html
@@ -74,10 +74,10 @@
<p class="card-text">{{ event.name }}</p>
{% for certificate in event.certificate_set.all %}
<div class="d-flex justify-content-between align-items-center">
- <p>{{ certificate.description }}
+ <p>Certificate {{ certificate.description }}
<div class="btn-group">
<a type="button" href="{% url 'certificate_download' certificate.id %}" class="btn btn-sm btn-outline-secondary">Download</a>
- <!--<a type="button" href="{% url 'verify' %}" class="btn btn-sm btn-outline-secondary">Verify</a>-->
+ <a type="button" href="{% url 'verify' %}" class="btn btn-sm btn-outline-secondary">Verify</a>
</div>
</div>
<!--<small class="text-muted">9 Downloads</small>-->