From e8b0b639ee7ef424211f551fc251fc980355a08f Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Wed, 27 Apr 2016 13:32:38 +0000 Subject: [PATCH] Added services missing migrations --- orchestra/contrib/history/apps.py | 6 +++--- orchestra/contrib/orders/models.py | 3 +-- orchestra/views.py | 4 ++-- requirements.txt | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/orchestra/contrib/history/apps.py b/orchestra/contrib/history/apps.py index 6ec322ef..0c00a4cb 100644 --- a/orchestra/contrib/history/apps.py +++ b/orchestra/contrib/history/apps.py @@ -13,6 +13,6 @@ class HistoryConfig(AppConfig): LogEntry, verbose_name='History', verbose_name_plural='History', icon='History.png' ) # prevent loosing creation time on log entry edition - action_time = LogEntry._meta.get_field_by_name('action_time')[0] - action_time.auto_now = False - action_time.auto_now_add = True +# action_time = LogEntry._meta.get_field_by_name('action_time')[0] +# action_time.auto_now = False +# action_time.auto_now_add = True diff --git a/orchestra/contrib/orders/models.py b/orchestra/contrib/orders/models.py index e055194c..c622798b 100644 --- a/orchestra/contrib/orders/models.py +++ b/orchestra/contrib/orders/models.py @@ -296,8 +296,7 @@ class MetricStorage(models.Model): """ Stores metric state for future billing """ order = models.ForeignKey(Order, verbose_name=_("order"), related_name='metrics') value = models.DecimalField(_("value"), max_digits=16, decimal_places=2) - created_on = models.DateField(_("created"), auto_now_add=True) - created_on.editable = True + created_on = models.DateField(_("created"), auto_now_add=True, editable=True) # TODO time field? updated_on = models.DateTimeField(_("updated")) diff --git a/orchestra/views.py b/orchestra/views.py index 31067678..5b5e5652 100644 --- a/orchestra/views.py +++ b/orchestra/views.py @@ -1,13 +1,13 @@ +from django.apps import apps from django.http import Http404 from django.contrib.admin.utils import unquote from django.core.exceptions import PermissionDenied -from django.db.models import get_model from django.shortcuts import get_object_or_404 from django.views.static import serve def serve_private_media(request, app_label, model_name, field_name, object_id, filename): - model = get_model(app_label, model_name) + model = apps.get_model(app_label, model_name) if model is None: raise Http404('') instance = get_object_or_404(model, pk=unquote(object_id)) diff --git a/requirements.txt b/requirements.txt index 884ac771..d0add178 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ Pygments==1.6 django-filter==0.7 jsonfield==0.9.22 python-dateutil==2.2 -passlib==1.6.5 +https://github.com/glic3rinu/passlib/archive/master.zip django-iban==0.3.0 requests phonenumbers