summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorprathamesh2020-12-04 12:38:55 +0530
committerprathamesh2020-12-04 12:38:55 +0530
commitf5224d8d1866122ad2ecfb3118ffd724c4dd3cf8 (patch)
treee88a1ed559d9f684b7bd517e572ae86e69650c1a /yaksh/models.py
parent01efe49e230163d276c340a7de7317a949dde31a (diff)
downloadonline_test-f5224d8d1866122ad2ecfb3118ffd724c4dd3cf8.tar.gz
online_test-f5224d8d1866122ad2ecfb3118ffd724c4dd3cf8.tar.bz2
online_test-f5224d8d1866122ad2ecfb3118ffd724c4dd3cf8.zip
Add Test Case for upload using QR Code
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 3182cc8..407435e 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -30,7 +30,7 @@ import qrcode
import hashlib
# Django Imports
-from django.db import models
+from django.db import models, IntegrityError
from django.contrib.auth.models import User, Group, Permission
from django.core.exceptions import ValidationError
from django.contrib.contenttypes.models import ContentType
@@ -3216,8 +3216,9 @@ class QRcode(models.Model):
for i in range(40):
try:
self.short_key = key[0:num]
+ self.save()
break
- except django.db.IntegrityError:
+ except IntegrityError:
num = num + 1
def generate_image(self, content):