kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
Added privacy level for user
rodzic
691665e3cf
commit
fd7c1e5dd8
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.0.2 on 2018-03-01 19:30
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('users', '0003_auto_20171226_1357'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='user',
|
||||
name='privacy_level',
|
||||
field=models.CharField(choices=[('me', 'Only me'), ('followers', 'Me and my followers'), ('instance', 'Everyone on my instance, and my followers'), ('everyone', 'Everyone, including people on other instances')], default='instance', max_length=30),
|
||||
),
|
||||
]
|
|
@ -11,6 +11,14 @@ from django.utils.encoding import python_2_unicode_compatible
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
|
||||
|
||||
PRIVACY_LEVEL_CHOICES = [
|
||||
('me', 'Only me'),
|
||||
('followers', 'Me and my followers'),
|
||||
('instance', 'Everyone on my instance, and my followers'),
|
||||
('everyone', 'Everyone, including people on other instances'),
|
||||
]
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class User(AbstractUser):
|
||||
|
||||
|
@ -31,6 +39,9 @@ class User(AbstractUser):
|
|||
},
|
||||
}
|
||||
|
||||
privacy_level = models.CharField(
|
||||
max_length=30, choices=PRIVACY_LEVEL_CHOICES, default='instance')
|
||||
|
||||
def __str__(self):
|
||||
return self.username
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue