Skip to content

Commit

Permalink
Merge pull request #373 from richardstephens/master
Browse files Browse the repository at this point in the history
fix compatibility issues with Django 1.10
  • Loading branch information
bernardopires committed Sep 9, 2016
2 parents 1427ccd + e8b7f2b commit 90f8b14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tenant_schemas/management/commands/migrate_schemas.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.conf import settings
from django.core.management.commands.migrate import Command as MigrateCommand
from django.db import connection
import django


from tenant_schemas.management.commands import SyncCommon
from tenant_schemas.utils import get_tenant_model, get_public_schema_name, schema_exists
Expand All @@ -13,7 +15,8 @@ def __init__(self, stdout=None, stderr=None, no_color=False):
"""
Changes the option_list to use the options from the wrapped migrate command.
"""
self.option_list += MigrateCommand.option_list
if django.VERSION <= (1,10,0):
self.option_list += MigrateCommand.option_list
super(Command, self).__init__(stdout, stderr, no_color)

def add_arguments(self, parser):
Expand Down
3 changes: 2 additions & 1 deletion tenant_schemas/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from django.http import Http404
from tenant_schemas.utils import (get_tenant_model, remove_www,
get_public_schema_name)
from django.utils.deprecation import MiddlewareMixin


class TenantMiddleware(object):
class TenantMiddleware(MiddlewareMixin):
"""
This middleware should be placed at the very top of the middleware stack.
Selects the proper database schema using the request host. Can fail in
Expand Down

0 comments on commit 90f8b14

Please sign in to comment.