Skip to content

Commit df9974d

Browse files
📃 updated docs to include signals documentation.
1 parent 7942245 commit df9974d

File tree

4 files changed

+35
-15
lines changed

4 files changed

+35
-15
lines changed

HISTORY.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,22 @@
22
History
33
=======
44

5-
0.1.0 (2022-02-02)
5+
0.1.2 (2022-02-26)
66
------------------
7-
8-
* First release on PyPI.
9-
10-
* Authentication with github.
11-
* Create user account with github.
12-
* Track state.
7+
* Added ``github_user_created`` signal.
138

149
0.1.1 (2022-02-04)
1510
------------------
1611

1712
* Minor updates.
1813

1914
* No explicit ``makemigrations`` required.
15+
16+
0.1.0 (2022-02-02)
17+
------------------
18+
19+
* First release on PyPI.
20+
21+
* Authentication with github.
22+
* Create user account with github.
23+
* Track state.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Contents:
1717

1818
Getting Started<readme>
1919
installation
20-
usage
20+
signals
2121
contributing
2222
authors
2323
history

docs/signals.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Signals
2+
========
3+
4+
5+
``django-rest-github-oauth`` provides the following signals:
6+
7+
``github_user_created``
8+
-----------------------
9+
Sent when a new GitHub user is created. The signal is sent with the
10+
newly created user instance as one of the keywords arguments.
11+
The user is instance of default User model specified in ``settings.py``.
12+
13+
.. code-block:: python
14+
15+
from django.contrib.auth.models import User
16+
from django.dispatch import receiver
17+
from rest_github_oauth.signals import github_user_created
18+
19+
@receiver(github_user_created)
20+
def my_callback(sender, **kwargs):
21+
user: User = kwargs['user']
22+
# do something with the user
23+
# ...

docs/usage.rst

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)