# Path: brasilcomvc/common/email.py
# def send_template_email(subject, to, template_name, context=None):
#     '''
#     Render a template into an email body and send it through Django's send_mail
# 
#     - The `to` parameter must be a single email address.
#     - This function omits `from_email` because it expects it to exist from an
#     environment variable.
#     - Other parameters are omitted as well because there are no
#     use for them in the current use case.
#     '''
#     body = render_to_string(template_name, context or {}, Context({
#         'mailing_address': settings.MAILING_ADDRESS,
#         'site_url': settings.BASE_URL,
#         'sns_facebook': settings.SNS_FACEBOOK,
#         'sns_googleplus': settings.SNS_GOOGLEPLUS,
#         'sns_twitter': settings.SNS_TWITTER,
#         'subject': subject,
#     }))
#     plain_body = strip_tags(body)
# 
#     email = EmailMultiAlternatives(
#         subject=subject,
#         body=plain_body,
#         to=(to,))
#     email.attach_alternative(body, 'text/html')
#     email.send()
# 
# Path: brasilcomvc/accounts/models.py
# class UserAddress(models.Model):
# 
#     user = models.OneToOneField('User', related_name='address', editable=False)
#     zipcode = models.CharField(max_length=90)
#     address_line1 = models.CharField(max_length=120)
#     address_line2 = models.CharField(max_length=80, blank=True)
#     state = models.ForeignKey('cities_light.Region')
#     city = models.ForeignKey('cities_light.City')
# 
#     # Verbose names
#     zipcode.verbose_name = 'CEP'
#     address_line1.verbose_name = 'endereço'
#     address_line2.verbose_name = 'complemento'
#     state.verbose_name = 'estado'
#     city.verbose_name = 'cidade'


from itertools import groupby
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import (
    AuthenticationForm,
    PasswordResetForm as djangoPasswordResetForm,
)
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode
from brasilcomvc.common.email import send_template_email
from cities_light.models import City, Region
from .models import UserAddress
# -*- coding: utf-8 -*-
from __future__ import unicode_literals





User = get_user_model()


class DeleteUserForm(forms.Form):

    password = forms.CharField(label='Senha', widget=forms.PasswordInput)

    def __init__(self, user, *args, **kwargs):

# Path: brasilcomvc/common/email.py
# def send_template_email(subject, to, template_name, context=None):
#     '''
#     Render a template into an email body and send it through Django's send_mail
# 
#     - The `to` parameter must be a single email address.
#     - This function omits `from_email` because it expects it to exist from an
#     environment variable.
#     - Other parameters are omitted as well because there are no
#     use for them in the current use case.
#     '''
#     body = render_to_string(template_name, context or {}, Context({
#         'mailing_address': settings.MAILING_ADDRESS,
#         'site_url': settings.BASE_URL,
#         'sns_facebook': settings.SNS_FACEBOOK,
#         'sns_googleplus': settings.SNS_GOOGLEPLUS,
#         'sns_twitter': settings.SNS_TWITTER,
#         'subject': subject,
#     }))
#     plain_body = strip_tags(body)
# 
#     email = EmailMultiAlternatives(
#         subject=subject,
#         body=plain_body,
#         to=(to,))
#     email.attach_alternative(body, 'text/html')
#     email.send()
# 
# Path: brasilcomvc/accounts/models.py
# class UserAddress(models.Model):
# 
#     user = models.OneToOneField('User', related_name='address', editable=False)
#     zipcode = models.CharField(max_length=90)
#     address_line1 = models.CharField(max_length=120)
#     address_line2 = models.CharField(max_length=80, blank=True)
#     state = models.ForeignKey('cities_light.Region')
#     city = models.ForeignKey('cities_light.City')
# 
#     # Verbose names
#     zipcode.verbose_name = 'CEP'
#     address_line1.verbose_name = 'endereço'
#     address_line2.verbose_name = 'complemento'
#     state.verbose_name = 'estado'
#     city.verbose_name = 'cidade'


# Path: brasilcomvc/accounts/forms.py
from itertools import groupby
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import (
    AuthenticationForm,
    PasswordResetForm as djangoPasswordResetForm,
)
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.shortcuts import get_current_site
from django.core.urlresolvers import reverse
from django.utils.encoding import force_bytes
from django.utils.http import urlsafe_base64_encode
from brasilcomvc.common.email import send_template_email
from cities_light.models import City, Region
from .models import UserAddress

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





User = get_user_model()


class DeleteUserForm(forms.Form):

    password = forms.CharField(label='Senha', widget=forms.PasswordInput)

    def __init__(self, user, *args, **kwargs):

        super(DeleteUserForm, self).__init__(*args, **kwargs)