Commits

Stanislav Panasik committed c950c05

Do not fire warning about default group creation when admin is created

  • Participants
  • Parent commits f26db89

Comments (0)

Files changed (1)

         ReadTracking.objects.create(user=instance)
         pybb_group, created = Group.objects.get_or_create(name=PYBB_DEFAULT_USERS_GROUP)
         if created:
-            raise ObjectDoesNotExist("Please execute command manage.py pybb_create_related_objects, default group for pybb users does not exist.")
+            if not instance.is_superuser:
+                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()