~netlandish/django-wiki

affa15949911228d0adb55fb325253665f0c127a — benjaoming 11 years ago d004700
Make django notify admin configurable so it can be excluded
2 files changed, 13 insertions(+), 4 deletions(-)

M django_notify/admin.py
M django_notify/settings.py
M django_notify/admin.py => django_notify/admin.py +6 -4
@@ 1,8 1,10 @@
from django.contrib import admin

from django_notify import models
from django_notify import settings

admin.site.register(models.NotificationType)
admin.site.register(models.Notification)
admin.site.register(models.Settings)
admin.site.register(models.Subscription)
\ No newline at end of file
if settings.ENABLE_ADMIN:
    admin.site.register(models.NotificationType)
    admin.site.register(models.Notification)
    admin.site.register(models.Settings)
    admin.site.register(models.Subscription)
\ No newline at end of file

M django_notify/settings.py => django_notify/settings.py +7 -0
@@ 7,6 7,13 @@ DB_TABLE_PREFIX = 'notify'
# You need to switch this setting on, otherwise nothing will happen :)
ENABLED = getattr(django_settings, "NOTIFY_ENABLED", True)

# Enable django-admin registration
ENABLE_ADMIN = getattr(django_settings, "NOTIFY_ENABLE_ADMIN", False)

##################################
# PLANNED CONFIGURATION SETTINGS #
##################################

# Email notifications are just optional... if you don't have access
# to a proper SMTP server, just leave it off...
SEND_EMAILS = getattr(django_settings, "NOTIFY_SEND_EMAILS", False)