Commits

Stanislav Panasik committed b514774

changed the verification check for default group existance

  • Participants
  • Parent commits c950c05

Comments (0)

Files changed (1)

 from django.db.models.signals import post_save
 from django.contrib.auth.models import User,Group
+from django.core.exceptions import ObjectDoesNotExist
 
 from pybb.subscription import notify_topic_subscribers
 from pybb.models import Post, Topic, Profile, ReadTracking
         ReadTracking.objects.create(user=instance)
         pybb_group, created = Group.objects.get_or_create(name=PYBB_DEFAULT_USERS_GROUP)
         if created:
-            if not instance.is_superuser:
+            if len(User.objects.all()) > 1:
                 raise ObjectDoesNotExist("Please execute command manage.py pybb_create_related_objects, default group for pybb users does not exist.")
         instance.groups.add(pybb_group)
         instance.save()