From a75461aa5cad4cef9769af89564a204715b14c80 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sat, 16 May 2020 16:27:18 +0200 Subject: [PATCH] add option to not share contact details --- .../aa/migrations/0005_auto_20200516_1623.py | 26 +++++++++++++++++++ panikdb/aa/models.py | 2 +- panikdb/aa/views.py | 2 +- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 panikdb/aa/migrations/0005_auto_20200516_1623.py diff --git a/panikdb/aa/migrations/0005_auto_20200516_1623.py b/panikdb/aa/migrations/0005_auto_20200516_1623.py new file mode 100644 index 0000000..46b420d --- /dev/null +++ b/panikdb/aa/migrations/0005_auto_20200516_1623.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.29 on 2020-05-16 16:23 +from __future__ import unicode_literals + +import django.contrib.auth.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('aa', '0004_auto_20170418_1155'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='share_contact_details', + field=models.BooleanField(default=True, verbose_name='Share contact detais with members'), + ), + migrations.AlterField( + model_name='user', + name='username', + field=models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username'), + ), + ] diff --git a/panikdb/aa/models.py b/panikdb/aa/models.py index a3214a5..dd65e5a 100644 --- a/panikdb/aa/models.py +++ b/panikdb/aa/models.py @@ -14,7 +14,7 @@ class User(AbstractUser): phone = models.CharField(_('Phone'), max_length=20, null=True, blank=True) mobile = models.CharField(_('Mobile'), max_length=20, null=True, blank=True) - share_contact_details = models.BooleanField(_('Share contact detais'), default=True) + share_contact_details = models.BooleanField(_('Share contact detais with members'), default=True) class Meta: ordering = ['first_name', 'last_name'] diff --git a/panikdb/aa/views.py b/panikdb/aa/views.py index 074f34d..90d8513 100644 --- a/panikdb/aa/views.py +++ b/panikdb/aa/views.py @@ -15,7 +15,7 @@ profile_view = login_required(ProfileView.as_view()) class ProfileContactEditView(UpdateView): model = User - fields = ['phone', 'mobile'] + fields = ['phone', 'mobile', 'share_contact_details'] success_url = reverse_lazy('profile-view') def get_object(self): -- 2.39.2