summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index efe772c..9f34ade 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -3358,6 +3358,9 @@ class QRcode(models.Model):
except IntegrityError:
num = num + 1
+ def is_qrcode_available(self):
+ return self.active and not self.used and self.image is not None
+
def generate_image(self, content):
img = qrcode.make(content)
qr_dir = os.path.join(settings.MEDIA_ROOT, 'qrcode')