diff --git a/ccdb/users/middleware.py b/ccdb/users/middleware.py deleted file mode 100644 index e1e72a6..0000000 --- a/ccdb/users/middleware.py +++ /dev/null @@ -1,13 +0,0 @@ -import pytz - -from django.utils import timezone - - -class TimezoneMiddleware(object): - def process_request(self, request): - if not request.user.is_anonymous(): - tzname = request.user.timezone - if tzname: - timezone.activate(pytz.timezone(tzname)) - else: - timezone.deactivate() diff --git a/ccdb/users/migrations/0003_remove_user_timezone.py b/ccdb/users/migrations/0003_remove_user_timezone.py new file mode 100644 index 0000000..db8415c --- /dev/null +++ b/ccdb/users/migrations/0003_remove_user_timezone.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0002_timezone'), + ] + + operations = [ + migrations.RemoveField( + model_name='user', + name='timezone', + ), + ] diff --git a/ccdb/users/models.py b/ccdb/users/models.py index 3a8dcb6..c1afa06 100644 --- a/ccdb/users/models.py +++ b/ccdb/users/models.py @@ -3,15 +3,9 @@ from django.core.urlresolvers import reverse from django.db import models from django.utils.translation import ugettext_lazy as _ -import pytz - class User(AbstractUser): name = models.CharField(_("Name of User"), blank=True, max_length=255) - timezone = models.CharField(_("Current Timezone"), max_length=255, - default="UTC", - choices=[(x, x) for x in pytz.common_timezones], - blank=False) def __str__(self): return self.username diff --git a/config/settings/base.py b/config/settings/base.py index 024c6f9..d9d6a67 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -58,7 +58,6 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'ccdb.users.middleware.TimezoneMiddleware', ) # DEBUG