diff options
author | prathamesh | 2014-12-09 14:37:15 +0530 |
---|---|---|
committer | prathamesh | 2014-12-09 14:37:15 +0530 |
commit | 8233efece2f49f7cf91fd84db05474726615fd8e (patch) | |
tree | c0f3b965586d9a23418c5f66c60dd75257b04877 /certificate/views.py | |
parent | 15e90ea25a7d7ba2075f69435acd0b9db2c9c8a5 (diff) | |
download | certificate-generator-8233efece2f49f7cf91fd84db05474726615fd8e.tar.gz certificate-generator-8233efece2f49f7cf91fd84db05474726615fd8e.tar.bz2 certificate-generator-8233efece2f49f7cf91fd84db05474726615fd8e.zip |
Added text at the bottom of the certificate.
Added javascript and modified view to handle multiple
papers or workshop by one participant.
Diffstat (limited to 'certificate/views.py')
-rw-r--r-- | certificate/views.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/certificate/views.py b/certificate/views.py index 5ab2910..e9324b4 100644 --- a/certificate/views.py +++ b/certificate/views.py @@ -31,7 +31,8 @@ def download(request): elif type == 'A': if paper: user = Scilab_speaker.objects.filter(email=email, paper=paper) - user = [user[0]] + if user: + user = [user[0]] else: user = Scilab_speaker.objects.filter(email=email) if not user: @@ -47,7 +48,8 @@ def download(request): elif type == 'W': if workshop: user = Scilab_workshop.objects.filter(email=email, workshops=workshop) - user = [user[0]] + if user: + user = [user[0]] else: user = Scilab_workshop.objects.filter(email=email) if not user: @@ -66,7 +68,7 @@ def download(request): id = int(user.id) hexa = hex(id).replace('0x','').zfill(6).upper() serial_no = '{0}{1}{2}{3}'.format(purpose, year, hexa, type) - qrcode = '{0}\n{1}'.format(name, serial_no) + qrcode = 'NAME: {0} SERIAL NO: {1}'.format(name, serial_no) file_name = '{0}{1}'.format(email,id) file_name = file_name.replace('.', '') try: |