Skip to content

Commit fa32eff

Browse files
committed
Sync community auth plugin to be the latest-and-greatest
Combine changes from downstream projects (which were not that many anymore)
1 parent 4b873cd commit fa32eff

File tree

1 file changed

+13
-1
lines changed
  • tools/communityauth/sample/django

1 file changed

+13
-1
lines changed

tools/communityauth/sample/django/auth.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,25 @@ def auth_receive(request):
133133
a different username than %s.
134134
135135
This is almost certainly caused by some legacy data in our database.
136-
Please send an email to webmaster@postgresql.eu, indicating the username
136+
Please send an email to webmaster@postgresql.org, indicating the username
137137
and email address from above, and we'll manually merge the two accounts
138138
for you.
139139
140140
We apologize for the inconvenience.
141141
""" % (data['e'][0], data['u'][0]), content_type='text/plain')
142142

143+
if getattr(settings, 'PGAUTH_CREATEUSER_CALLBACK', None):
144+
res = getattr(settings, 'PGAUTH_CREATEUSER_CALLBACK')(
145+
data['u'][0],
146+
data['e'][0],
147+
['f'][0],
148+
data['l'][0],
149+
)
150+
# If anything is returned, we'll return that as our result.
151+
# If None is returned, it means go ahead and create the user.
152+
if res:
153+
return res
154+
143155
user = User(username=data['u'][0],
144156
first_name=data['f'][0],
145157
last_name=data['l'][0],

0 commit comments

Comments
 (0)