mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-10 00:42:06 +00:00
Sync community auth plugin to be the latest-and-greatest
Combine changes from downstream projects (which were not that many anymore)
This commit is contained in:
@ -133,13 +133,25 @@ def auth_receive(request):
|
|||||||
a different username than %s.
|
a different username than %s.
|
||||||
|
|
||||||
This is almost certainly caused by some legacy data in our database.
|
This is almost certainly caused by some legacy data in our database.
|
||||||
Please send an email to webmaster@postgresql.eu, indicating the username
|
Please send an email to webmaster@postgresql.org, indicating the username
|
||||||
and email address from above, and we'll manually merge the two accounts
|
and email address from above, and we'll manually merge the two accounts
|
||||||
for you.
|
for you.
|
||||||
|
|
||||||
We apologize for the inconvenience.
|
We apologize for the inconvenience.
|
||||||
""" % (data['e'][0], data['u'][0]), content_type='text/plain')
|
""" % (data['e'][0], data['u'][0]), content_type='text/plain')
|
||||||
|
|
||||||
|
if getattr(settings, 'PGAUTH_CREATEUSER_CALLBACK', None):
|
||||||
|
res = getattr(settings, 'PGAUTH_CREATEUSER_CALLBACK')(
|
||||||
|
data['u'][0],
|
||||||
|
data['e'][0],
|
||||||
|
['f'][0],
|
||||||
|
data['l'][0],
|
||||||
|
)
|
||||||
|
# If anything is returned, we'll return that as our result.
|
||||||
|
# If None is returned, it means go ahead and create the user.
|
||||||
|
if res:
|
||||||
|
return res
|
||||||
|
|
||||||
user = User(username=data['u'][0],
|
user = User(username=data['u'][0],
|
||||||
first_name=data['f'][0],
|
first_name=data['f'][0],
|
||||||
last_name=data['l'][0],
|
last_name=data['l'][0],
|
||||||
|
Reference in New Issue
Block a user