]> git.0d.be Git - panikdb.git/commitdiff
add option to not share contact details
authorFrédéric Péters <fpeters@0d.be>
Sat, 16 May 2020 14:27:18 +0000 (16:27 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 16 May 2020 14:27:18 +0000 (16:27 +0200)
panikdb/aa/migrations/0005_auto_20200516_1623.py [new file with mode: 0644]
panikdb/aa/models.py
panikdb/aa/views.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 (file)
index 0000000..46b420d
--- /dev/null
@@ -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'),
+        ),
+    ]
index a3214a5558e745adf4c1ef883ff99bee9e04e97c..dd65e5a1551e6edb3fbcb06badd39e3ad28283bb 100644 (file)
@@ -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)
 
     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']
 
     class Meta:
         ordering = ['first_name', 'last_name']
index 074f34d35d775384d434a2b0db733f781b7006ee..90d8513ea50d745b4a2c6f3b4947db32d7cbdf15 100644 (file)
@@ -15,7 +15,7 @@ profile_view = login_required(ProfileView.as_view())
 
 class ProfileContactEditView(UpdateView):
     model = User
 
 class ProfileContactEditView(UpdateView):
     model = User
-    fields = ['phone', 'mobile']
+    fields = ['phone', 'mobile', 'share_contact_details']
     success_url = reverse_lazy('profile-view')
 
     def get_object(self):
     success_url = reverse_lazy('profile-view')
 
     def get_object(self):