use getattr for getting AUHT_OPENID, DISCO_SERVICE and AUTH_SSL settings
This commit is contained in:
parent
b72dc3a488
commit
37c7617294
|
@ -33,7 +33,7 @@ def LogAssociatedOI(sender, user, openid, **kwargs):
|
|||
msg = user.username + ' has associated his user with ' + openid
|
||||
logging.info(msg)
|
||||
|
||||
if settings.AUTH_OPENID:
|
||||
if getattr(settings, 'AUTH_OPENID', False):
|
||||
from django_authopenid.signals import oid_register
|
||||
from django_authopenid.signals import oid_associate
|
||||
oid_register.connect(LogRegisteredOI, dispatch_uid = "authentic2.idp")
|
||||
|
|
|
@ -25,20 +25,20 @@ not_homepage_patterns += patterns('',
|
|||
url(r'^idp/', include('authentic2.idp.urls')),
|
||||
)
|
||||
|
||||
if settings.AUTH_OPENID:
|
||||
if getattr(settings, 'AUTH_OPENID', False):
|
||||
not_homepage_patterns += patterns('',
|
||||
(r'^accounts/openid/',
|
||||
include('authentic2.auth2_auth.auth2_openid.urls')),
|
||||
)
|
||||
|
||||
if settings.AUTH_SSL:
|
||||
if getattr(settings, 'AUTH_SSL', False):
|
||||
not_homepage_patterns += patterns('',
|
||||
url(r'^accounts/sslauth/', include('authentic2.auth2_auth.auth2_ssl.urls')))
|
||||
|
||||
urlpatterns += not_homepage_patterns
|
||||
|
||||
try:
|
||||
if settings.DISCO_SERVICE:
|
||||
if getattr(settings, 'DISCO_SERVICE', False):
|
||||
urlpatterns += patterns('',
|
||||
(r'^disco_service/', include('disco_service.disco_responder')),
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue