summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--certificate/models.py1
-rw-r--r--certificate/views.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/certificate/models.py b/certificate/models.py
index 0737caf..672837e 100644
--- a/certificate/models.py
+++ b/certificate/models.py
@@ -28,6 +28,7 @@ class Certificate(models.Model):
counter = models.IntegerField()
workshop = models.CharField(max_length=100, null=True, blank=True)
paper = models.CharField(max_length=100, null=True, blank=True)
+ verified = models.IntegerField(default=0)
class Scilab_participant(models.Model):
''' Autogenerated model file csvimport Mon Dec 1 07:46:00 2014 '''
diff --git a/certificate/views.py b/certificate/views.py
index 5be6f0f..e17592d 100644
--- a/certificate/views.py
+++ b/certificate/views.py
@@ -104,9 +104,11 @@ def verify(request):
context["invalidserial"] = 1
return render_to_response('verify.html', context, context_instance=ci)
else:
- name = certificate.name
+ name = certificate.name.title()
paper = certificate.paper
workshop = certificate.workshop
+ certificate.verified += 1
+ certificate.save()
purpose, year, type = _get_detail(serial_no)
if type == 'P':
detail = '{0} had attended {1} {2}'.format(name, purpose, year)