DEV Community

Vicente G. Reyes
Vicente G. Reyes

Posted on

django.db.utils.IntegrityError: UNIQUE constraint failed: accounts_profile.user_id

I'm having issues with registering a user in my project. I have a custom serializer that inherits from the RegisterView of dj_rest_auth. My code is:

views.py

class ProfileDetail(APIView)
    def get_object(self, pk):
        try:
            return Profile.objects.get(pk=pk)
        except Profile.DoesNotExist:
            raise Http404

    def get(self, request, pk, format=None):
        profile = self.get_object(pk)
        serializer = ProfileSerializer(profile)
โ€ฆ

Top comments (0)

Image of Docusign

๐Ÿ› ๏ธ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more