Add theme field to User
parent
4163d42163
commit
f2d9eb6326
|
@ -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,
|
||||
),
|
||||
]
|
|
@ -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
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue