changeset 917:0365fdbb4d78

Fix app conflict with messages. Django's messages app label conflicts with our messages app. We can't easily rename our label as that will make us rename database tables. Since our app came first we'll just customize Django messages label. For Django 1.7.7 upgrade.
author Brian Neal <bgneal@gmail.com>
date Mon, 06 Apr 2015 20:02:25 -0500
parents 1cb227d59e20
children 886234943aed
files messages/apps.py sg101/apps.py sg101/settings/base.py
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/messages/apps.py	Mon Apr 06 19:36:38 2015 -0500
+++ b/messages/apps.py	Mon Apr 06 20:02:25 2015 -0500
@@ -1,6 +1,6 @@
 from django.apps import AppConfig
 
+
 class MessagesConfig(AppConfig):
     name = 'messages'
     verbose_name = 'Private Messages'
-    label = 'private_messages'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sg101/apps.py	Mon Apr 06 20:02:25 2015 -0500
@@ -0,0 +1,8 @@
+from django.contrib.messages.apps import MessagesConfig
+
+
+# The Django messages app conflicts with our own messages app.
+# Override the label to fix this.
+
+class DjangoMessagesConfig(MessagesConfig):
+    label = 'django_messages'
--- a/sg101/settings/base.py	Mon Apr 06 19:36:38 2015 -0500
+++ b/sg101/settings/base.py	Mon Apr 06 20:02:25 2015 -0500
@@ -103,7 +103,7 @@
     'django.contrib.contenttypes',
     'django.contrib.flatpages',
     'django.contrib.humanize',
-    'django.contrib.messages',
+    'sg101.apps.DjangoMessagesConfig',
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.staticfiles',