# Path: yak/rest_social_auth/serializers.py
# class SocialSignUpSerializer(AuthSerializerMixin, LoginSerializer):
#     fullname = serializers.CharField(read_only=True)
#     username = serializers.CharField(read_only=True)
#     email = serializers.EmailField(read_only=True)
# 
#     class Meta:
#         model = User
#         fields = ('fullname', 'username', 'email')
#         write_only_fields = ('access_token', 'access_token_secret')
# 
# Path: yak/rest_social_auth/utils.py
# @task
# def post_social_media(user_social_auth, social_obj):
#     backend = get_backend(settings.AUTHENTICATION_BACKENDS, user_social_auth.provider)
#     backend.post(user_social_auth, social_obj)
# 
# Path: yak/rest_user/serializers.py
# class UserSerializer(AuthSerializerMixin, YAKModelSerializer):
# 
#     def __new__(cls, *args, **kwargs):
#         """
#         Can't just inherit in the class definition due to lots of import issues
#         """
#         return yak_settings.USER_SERIALIZER(*args, **kwargs)
# 
# Path: yak/rest_user/views.py
# class SignUp(generics.CreateAPIView):
#     queryset = User.objects.all()
#     serializer_class = SignUpSerializer
#     permission_classes = (IsAuthenticatedOrCreate,)


import base64
from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework import status, generics
from rest_framework.decorators import detail_route
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from social_django.utils import load_strategy
from social_django.models import UserSocialAuth
from social_django.utils import load_backend
from social_core.backends.oauth import BaseOAuth1, BaseOAuth2
from social_core.backends.utils import get_backend
from social_core.exceptions import AuthAlreadyAssociated
from yak.rest_social_auth.serializers import SocialSignUpSerializer
from yak.rest_social_auth.utils import post_social_media
from yak.rest_user.serializers import UserSerializer
from yak.rest_user.views import SignUp


User = get_user_model()


class SocialSignUp(SignUp):
    serializer_class = SocialSignUpSerializer


# Path: yak/rest_social_auth/serializers.py
# class SocialSignUpSerializer(AuthSerializerMixin, LoginSerializer):
#     fullname = serializers.CharField(read_only=True)
#     username = serializers.CharField(read_only=True)
#     email = serializers.EmailField(read_only=True)
# 
#     class Meta:
#         model = User
#         fields = ('fullname', 'username', 'email')
#         write_only_fields = ('access_token', 'access_token_secret')
# 
# Path: yak/rest_social_auth/utils.py
# @task
# def post_social_media(user_social_auth, social_obj):
#     backend = get_backend(settings.AUTHENTICATION_BACKENDS, user_social_auth.provider)
#     backend.post(user_social_auth, social_obj)
# 
# Path: yak/rest_user/serializers.py
# class UserSerializer(AuthSerializerMixin, YAKModelSerializer):
# 
#     def __new__(cls, *args, **kwargs):
#         """
#         Can't just inherit in the class definition due to lots of import issues
#         """
#         return yak_settings.USER_SERIALIZER(*args, **kwargs)
# 
# Path: yak/rest_user/views.py
# class SignUp(generics.CreateAPIView):
#     queryset = User.objects.all()
#     serializer_class = SignUpSerializer
#     permission_classes = (IsAuthenticatedOrCreate,)


# Path: yak/rest_social_auth/views.py
import base64
from django.conf import settings
from django.contrib.auth import get_user_model
from rest_framework import status, generics
from rest_framework.decorators import detail_route
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from social_django.utils import load_strategy
from social_django.models import UserSocialAuth
from social_django.utils import load_backend
from social_core.backends.oauth import BaseOAuth1, BaseOAuth2
from social_core.backends.utils import get_backend
from social_core.exceptions import AuthAlreadyAssociated
from yak.rest_social_auth.serializers import SocialSignUpSerializer
from yak.rest_social_auth.utils import post_social_media
from yak.rest_user.serializers import UserSerializer
from yak.rest_user.views import SignUp



User = get_user_model()


class SocialSignUp(SignUp):
    serializer_class = SocialSignUpSerializer


    def create(self, request, *args, **kwargs):