# Path: brigitte/accounts/models.py
# class Profile(models.Model):
#     user = models.OneToOneField(User, unique=True)
#     short_info = models.TextField(_('Short info'), blank=True)
# 
#     def __unicode__(self):
#         return '%s %s' % (self.user.first_name, self.user.last_name)
# 
#     @property
#     def first_name(self):
#         return self.user.first_name
# 
#     @property
#     def last_name(self):
#         return self.user.last_name
# 
#     class Meta:
#         verbose_name = _('Profile')
#         verbose_name_plural = _('Profiles')
# 
# class SshPublicKey(models.Model):
#     user = models.ForeignKey(User, verbose_name=_('User'), blank=False)
#     description = models.CharField(_('Description'), max_length=250, blank=True)
#     can_read = models.BooleanField(_('Can read'), default=True)
#     can_write = models.BooleanField(_('Can write'), default=False)
#     key = models.TextField(_('Key'), blank=False, unique=True)
#     key_parsed = models.TextField(_('Key (parsed)'), blank=True, unique=True, editable=False)
# 
#     def __unicode__(self):
#         if self.description:
#             return self.description
#         else:
#             return self.short_key
# 
#     def save(self, *args, **kwargs):
#         self.key_parsed = self.key.split()[1]
#         super(SshPublicKey, self).save(*args, **kwargs)
# 
#     @property
#     def short_key(self):
#         return self.key[:32] + '...'
# 
#     @property
#     def can_read_html(self):
#         if self.can_read:
#             return mark_safe('&#10004;')
#         else:
#             return mark_safe('&#10008;')
# 
#     @property
#     def can_write_html(self):
#         if self.can_write:
#             return mark_safe('&#10004;')
#         else:
#             return mark_safe('&#10008;')
# 
#     class Meta:
#         verbose_name = _('SSH Public Key')
#         verbose_name_plural = _('SSH Public Keys')


import base64
import struct
from django import forms
from django.utils.translation import ugettext_lazy as _
from userprofiles.forms import RegistrationForm
from brigitte.accounts.models import Profile, SshPublicKey
# -*- coding: utf-8 -*-





class ProfileRegistrationForm(RegistrationForm):
    short_info = forms.CharField(widget=forms.Textarea, required=False)

    def save_profile(self, new_user, *args, **kwargs):

# Path: brigitte/accounts/models.py
# class Profile(models.Model):
#     user = models.OneToOneField(User, unique=True)
#     short_info = models.TextField(_('Short info'), blank=True)
# 
#     def __unicode__(self):
#         return '%s %s' % (self.user.first_name, self.user.last_name)
# 
#     @property
#     def first_name(self):
#         return self.user.first_name
# 
#     @property
#     def last_name(self):
#         return self.user.last_name
# 
#     class Meta:
#         verbose_name = _('Profile')
#         verbose_name_plural = _('Profiles')
# 
# class SshPublicKey(models.Model):
#     user = models.ForeignKey(User, verbose_name=_('User'), blank=False)
#     description = models.CharField(_('Description'), max_length=250, blank=True)
#     can_read = models.BooleanField(_('Can read'), default=True)
#     can_write = models.BooleanField(_('Can write'), default=False)
#     key = models.TextField(_('Key'), blank=False, unique=True)
#     key_parsed = models.TextField(_('Key (parsed)'), blank=True, unique=True, editable=False)
# 
#     def __unicode__(self):
#         if self.description:
#             return self.description
#         else:
#             return self.short_key
# 
#     def save(self, *args, **kwargs):
#         self.key_parsed = self.key.split()[1]
#         super(SshPublicKey, self).save(*args, **kwargs)
# 
#     @property
#     def short_key(self):
#         return self.key[:32] + '...'
# 
#     @property
#     def can_read_html(self):
#         if self.can_read:
#             return mark_safe('&#10004;')
#         else:
#             return mark_safe('&#10008;')
# 
#     @property
#     def can_write_html(self):
#         if self.can_write:
#             return mark_safe('&#10004;')
#         else:
#             return mark_safe('&#10008;')
# 
#     class Meta:
#         verbose_name = _('SSH Public Key')
#         verbose_name_plural = _('SSH Public Keys')


# Path: brigitte/accounts/forms.py
import base64
import struct
from django import forms
from django.utils.translation import ugettext_lazy as _
from userprofiles.forms import RegistrationForm
from brigitte.accounts.models import Profile, SshPublicKey

# -*- coding: utf-8 -*-





class ProfileRegistrationForm(RegistrationForm):
    short_info = forms.CharField(widget=forms.Textarea, required=False)

    def save_profile(self, new_user, *args, **kwargs):

        Profile.objects.create(