diff --git a/modoboa/core/forms.py b/modoboa/core/forms.py index c1d96aa28..8779ec0ac 100644 --- a/modoboa/core/forms.py +++ b/modoboa/core/forms.py @@ -45,7 +45,8 @@ class ProfileForm(forms.ModelForm): class Meta: model = User - fields = ("first_name", "last_name", "language") + fields = ("first_name", "last_name", "language", + "phone_number", "secondary_email") widgets = { 'first_name': forms.TextInput(attrs={'class': 'form-control'}), 'last_name': forms.TextInput(attrs={'class': 'form-control'}) diff --git a/modoboa/core/migrations/0006_auto_20151114_1518.py b/modoboa/core/migrations/0006_auto_20151114_1518.py new file mode 100644 index 000000000..e3c1b88af --- /dev/null +++ b/modoboa/core/migrations/0006_auto_20151114_1518.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0005_user_language'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='phone_number', + field=models.CharField(max_length=128, null=True, verbose_name='Phone number', blank=True), + preserve_default=True, + ), + migrations.AddField( + model_name='user', + name='secondary_email', + field=models.EmailField(help_text='An alternative e-mail address, can be used for recovery needs.', max_length=254, null=True, verbose_name='Secondary email', blank=True), + preserve_default=True, + ), + ] diff --git a/modoboa/core/models.py b/modoboa/core/models.py index 3b965bc3c..69684d9fe 100644 --- a/modoboa/core/models.py +++ b/modoboa/core/models.py @@ -68,6 +68,14 @@ class User(PermissionsMixin): "Prefered language to display pages." ) ) + phone_number = models.CharField( + ugettext_lazy("Phone number"), max_length=128, blank=True, null=True) + secondary_email = models.EmailField( + ugettext_lazy("Secondary email"), max_length=254, + blank=True, null=True, + help_text=ugettext_lazy( + "An alternative e-mail address, can be used for recovery needs.") + ) objects = UserManager()