Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntegrityError: duplicate key value violates unique constraint "auth_group_name_key" #2224

Open
sentryk8sonalabsorg bot opened this issue Apr 11, 2022 · 0 comments

Comments

@sentryk8sonalabsorg
Copy link

Sentry Issue:

DoesNotExist: Team matching query does not exist.
  File "onadata/apps/api/tools.py", line 179, in get_organization_members_team
    team = Team.objects.get(name=u'%s#%s' % (organization.user.username,
  File "django/db/models/manager.py", line 82, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "django/db/models/query.py", line 406, in get
    raise self.model.DoesNotExist(

UniqueViolation: duplicate key value violates unique constraint "auth_group_name_key"
DETAIL:  Key (name)=(members) already exists.

  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)

IntegrityError: duplicate key value violates unique constraint "auth_group_name_key"
DETAIL:  Key (name)=(members) already exists.

(32 additional frame(s) were not displayed)
...
  File "onadata/libs/serializers/organization_serializer.py", line 126, in get_users
    members = get_organization_members(obj) if obj else []
  File "onadata/apps/api/tools.py", line 280, in get_organization_members
    team = get_organization_members_team(organization)
  File "onadata/apps/api/tools.py", line 182, in get_organization_members_team
    team = create_organization_team(organization, MEMBERS)
  File "onadata/apps/api/tools.py", line 162, in create_organization_team
    team = Team.objects.create(organization=organization, name=name)
  File "onadata/apps/api/models/team.py", line 47, in save
    super(Team, self).save(*args, **kwargs)

IntegrityError: duplicate key value violates unique constraint "auth_group_name_key"
DETAIL:  Key (name)=(members) already exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant