From 020d1cefaeaf2545167e11e990251fc6b87ae760 Mon Sep 17 00:00:00 2001 From: Bryce Groff Date: Wed, 15 Jan 2014 13:39:38 -1000 Subject: [PATCH] - Use the Django 1.5 get_user_model function if it exists in Django, i.e. 1.5 and above. --- helpdesk/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helpdesk/models.py b/helpdesk/models.py index 15946286..ad6ba7c4 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -7,7 +7,11 @@ models.py - Model (and hence database) definitions. This is the core of the helpdesk structure. """ -from django.contrib.auth.models import User +try: + from django.contrib.auth import get_user_model + User = get_user_model() +except ImportError: + from django.contrib.auth.models import User from django.db import models from django.conf import settings from django.utils.translation import ugettext_lazy as _, ugettext