# Path: warp/users/models.py
# class User(AbstractUser):
# 
#     # First Name and Last Name do not cover name patterns
#     # around the globe.
#     name = models.CharField(_('Name of User'), blank=True, max_length=255)
# 
#     def __str__(self):
#         return self.username
# 
#     def get_profile_image_url(self):
#         social_image = None
#         if self.socialaccount_set.all():
#             social_image = self.socialaccount_set.all()[0].get_avatar_url()
#         if social_image:
#             return social_image
#         return '/static/images/default_profile.svg'
# 
#     def get_absolute_url(self):
#         return reverse('users:detail', kwargs={'username': self.username})


from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals



class MyUserChangeForm(UserChangeForm):
    class Meta(UserChangeForm.Meta):
        model = User


class MyUserCreationForm(UserCreationForm):

    error_message = UserCreationForm.error_messages.update({
        'duplicate_username': 'This username has already been taken.'
    })

    class Meta(UserCreationForm.Meta):

# Path: warp/users/models.py
# class User(AbstractUser):
# 
#     # First Name and Last Name do not cover name patterns
#     # around the globe.
#     name = models.CharField(_('Name of User'), blank=True, max_length=255)
# 
#     def __str__(self):
#         return self.username
# 
#     def get_profile_image_url(self):
#         social_image = None
#         if self.socialaccount_set.all():
#             social_image = self.socialaccount_set.all()[0].get_avatar_url()
#         if social_image:
#             return social_image
#         return '/static/images/default_profile.svg'
# 
#     def get_absolute_url(self):
#         return reverse('users:detail', kwargs={'username': self.username})


# Path: warp/users/admin.py
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User

# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals



class MyUserChangeForm(UserChangeForm):
    class Meta(UserChangeForm.Meta):
        model = User


class MyUserCreationForm(UserCreationForm):

    error_message = UserCreationForm.error_messages.update({
        'duplicate_username': 'This username has already been taken.'
    })

    class Meta(UserCreationForm.Meta):

        model = User