diff --git a/taiga/users/migrations/0011_user_theme.py b/taiga/users/migrations/0011_user_theme.py new file mode 100644 index 00000000..59f4daf0 --- /dev/null +++ b/taiga/users/migrations/0011_user_theme.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0010_auto_20150414_0936'), + ] + + operations = [ + migrations.AddField( + model_name='user', + name='theme', + field=models.CharField(null=True, blank=True, max_length=100, default='', verbose_name='default theme'), + preserve_default=True, + ), + ] diff --git a/taiga/users/models.py b/taiga/users/models.py index dc4eb862..345115be 100644 --- a/taiga/users/models.py +++ b/taiga/users/models.py @@ -118,6 +118,8 @@ class User(AbstractBaseUser, PermissionsMixin): date_joined = models.DateTimeField(_('date joined'), default=timezone.now) lang = models.CharField(max_length=20, null=True, blank=True, default="", verbose_name=_("default language")) + theme = models.CharField(max_length=100, null=True, blank=True, default="", + verbose_name=_("default theme")) timezone = models.CharField(max_length=20, null=True, blank=True, default="", verbose_name=_("default timezone")) colorize_tags = models.BooleanField(null=False, blank=True, default=False, @@ -167,6 +169,7 @@ class User(AbstractBaseUser, PermissionsMixin): self.color = "" self.bio = "" self.lang = "" + self.theme = "" self.timezone = "" self.colorize_tags = True self.token = None diff --git a/taiga/users/serializers.py b/taiga/users/serializers.py index 7b6276b5..934c0677 100644 --- a/taiga/users/serializers.py +++ b/taiga/users/serializers.py @@ -49,7 +49,7 @@ class UserSerializer(serializers.ModelSerializer): # IMPORTANT: Maintain the UserAdminSerializer Meta up to date # with this info (including there the email) fields = ("id", "username", "full_name", "full_name_display", - "color", "bio", "lang", "timezone", "is_active", + "color", "bio", "lang", "theme", "timezone", "is_active", "photo", "big_photo", "roles", "projects_with_me") read_only_fields = ("id",) @@ -103,7 +103,7 @@ class UserAdminSerializer(UserSerializer): # IMPORTANT: Maintain the UserSerializer Meta up to date # with this info (including here the email) fields = ("id", "username", "full_name", "full_name_display", "email", - "color", "bio", "lang", "timezone", "is_active", "photo", + "color", "bio", "lang", "theme", "timezone", "is_active", "photo", "big_photo") read_only_fields = ("id", "email")