Added privacy level for user

This commit is contained in:
Eliot Berriot 2018-03-01 20:36:29 +01:00
parent 691665e3cf
commit fd7c1e5dd8
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
2 changed files with 29 additions and 0 deletions

View file

@ -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