Skip to content

Commit

Permalink
Merge pull request zerok#14 from Raekkeri/silence-warnings
Browse files Browse the repository at this point in the history
Silence RemovedInDjango19Warning from `get_model`
  • Loading branch information
funkybob committed Sep 3, 2015
2 parents ff4380c + 258de4a commit aaf13b2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions flatblocks/templatetags/flatblocks.py
Expand Up @@ -47,19 +47,25 @@
"""
from __future__ import absolute_import

from django import template
from django import template, VERSION
from django.template.loader import render_to_string
from django.db import models

from flatblocks import settings

import logging

if VERSION >= (1, 7):
from django.apps import apps
get_model = apps.get_model
else:
from django.db import models
get_model = models.get_model


register = template.Library()
logger = logging.getLogger(__name__)

FlatBlock = models.get_model('flatblocks', 'flatblock')
FlatBlock = get_model('flatblocks', 'flatblock')


@register.simple_tag(takes_context=True)
Expand Down

0 comments on commit aaf13b2

Please sign in to comment.