auth.py
create_admin_user(uid, response, details, user, social, *args, **kwargs)
¶
Give Django admin privileges to a user who login via GitHub and belong to a specific team. The parameters are as per python-social-auth docs https://python-social-auth.readthedocs.io/en/latest/pipeline.html#extending-the-pipeline
Parameters:
Name | Type | Description | Default |
---|---|---|---|
uid | int | user id | required |
response | Dict | request dictionary | required |
details | Dict | user details generated by the backend | required |
user | User | Django user model object | required |
social | UserSocialAuth | Social auth user model object | required |
Returns:
Type | Description |
---|---|
Dict | A dictionary with the Django User object in it or empty if no action is taken. |
Source code in vast_pipeline/utils/auth.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
load_github_avatar(response, social, *args, **kwargs)
¶
Add GitHub avatar url to the extra data stored by social_django app
Parameters:
Name | Type | Description | Default |
---|---|---|---|
response | Dict | request dictionary | required |
social | UserSocialAuth | Social auth user model object | required |
*args | Variable length argument list. | () | |
**kwargs | Arbitrary keyword arguments. | {} |
Returns:
Type | Description |
---|---|
Dict | A dictionary with the Social auth user object in it or empty if no action is taken. |
Source code in vast_pipeline/utils/auth.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|