mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-05 18:34:52 +00:00
Add possibility to turn off django cauth using settings in sample
This sample is used across most of our other sites, so add functionality to install without having a local master repo. Back-patch of pgeu commit 3e4d8c9101c2d309b134c2f5638aa40db8ef2cf5
This commit is contained in:
@ -48,6 +48,11 @@ class AuthBackend(ModelBackend):
|
||||
|
||||
# Handle login requests by sending them off to the main site
|
||||
def login(request):
|
||||
if not hasattr(settings, 'PGAUTH_REDIRECT'):
|
||||
# No pgauth installed, so allow local installs.
|
||||
from django.contrib.auth.views import login
|
||||
return login(request, template_name='admin.html')
|
||||
|
||||
if request.GET.has_key('next'):
|
||||
# Put together an url-encoded dict of parameters we're getting back,
|
||||
# including a small nonce at the beginning to make sure it doesn't
|
||||
|
Reference in New Issue
Block a user