first commit
This commit is contained in:
19
accounts/pipeline.py
Normal file
19
accounts/pipeline.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""
|
||||
Custom pipeline functions for Python Social Auth.
|
||||
These functions are called during the social authentication process.
|
||||
"""
|
||||
|
||||
|
||||
def activate_user(strategy, details, user=None, *args, **kwargs):
|
||||
"""
|
||||
Custom pipeline step to ensure social auth users are active.
|
||||
|
||||
This ensures that users who register via social login don't need
|
||||
email activation - they are automatically activated since the social
|
||||
provider has already verified their email.
|
||||
"""
|
||||
if user and not user.is_active:
|
||||
user.is_active = True
|
||||
user.save(update_fields=['is_active'])
|
||||
return {'user': user}
|
||||
|
||||
Reference in New Issue
Block a user