def get_or_create_profile(self, user, save=False, **kwargs):
        try:
            profile = self.get_model().objects.get(user=user, **kwargs)
            return profile, False
        except self.get_model().DoesNotExist:
            profile = self.create_profile(user, save=save, **kwargs)
            return profile, True
Return a profile from DB or if there is none, create a new one.
dataset/ETHPy150Open flashingpumpkin/django-socialregistration/socialregistration/mixins.py/ProfileMixin.get_or_create_profile