From beaccf7128e9ed39ad8b6c34fd618d4f2bb95f7e Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 10 Jul 2014 01:49:02 -0400 Subject: [PATCH] Create the instance if it haven't already --- mayan/apps/registration/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mayan/apps/registration/models.py b/mayan/apps/registration/models.py index 84f34cc1b4..5955090100 100644 --- a/mayan/apps/registration/models.py +++ b/mayan/apps/registration/models.py @@ -26,7 +26,7 @@ class RegistrationSingleton(SingletonModel): if cls._registered: return cls._registered else: - instance = cls.objects.get() + instance, created = cls.objects.get_or_create() if instance.is_registered: cls._registered = instance.is_registered return instance.is_registered