Add avatar_version to UserProfile.

avatar_version is used to keep track of the avatar version of the
user and to update the cache, everytime the user updates their avatar.
This commit is contained in:
Adarsh S
2017-01-23 23:29:07 +05:30
parent bbd853e208
commit ec44edb305
2 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-23 17:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zerver', '0049_userprofile_pm_content_in_desktop_notifications'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='avatar_version',
field=models.PositiveSmallIntegerField(default=1),
),
]

View File

@@ -546,6 +546,7 @@ class UserProfile(ModelReprMixin, AbstractBaseUser, PermissionsMixin):
(AVATAR_FROM_USER, 'Uploaded by user'),
)
avatar_source = models.CharField(default=AVATAR_FROM_GRAVATAR, choices=AVATAR_SOURCES, max_length=1) # type: Text
avatar_version = models.PositiveSmallIntegerField(default=1) # type: int
TUTORIAL_WAITING = u'W'
TUTORIAL_STARTED = u'S'