mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-18 23:05:07 +01:00
more automated upgrades
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
This section describes how to extend **Alliance Auth** with custom apps and services.
|
||||
|
||||
```{toctree}
|
||||
:::{toctree}
|
||||
:maxdepth: 1
|
||||
|
||||
integrating-services
|
||||
menu-hooks
|
||||
url-hooks
|
||||
logging
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -46,10 +46,9 @@ In order to integrate with Alliance Auth service modules must provide a `service
|
||||
|
||||
This would register the ExampleService class which would need to be a subclass of `services.hooks.ServiceHook`.
|
||||
|
||||
```{eval-rst}
|
||||
.. important::
|
||||
:::{important}
|
||||
The hook **MUST** be registered in ``yourservice.auth_hooks`` along with any other hooks you are registering for Alliance Auth.
|
||||
```
|
||||
:::
|
||||
|
||||
A subclassed `ServiceHook` might look like this:
|
||||
|
||||
|
||||
@@ -40,13 +40,11 @@ A list of views or namespaces the link should be highlighted on. See [django-nav
|
||||
|
||||
This is a great feature to signal the user, that he has some open issues to take care of within an app. For example Auth uses this feature to show the specific number of open group request to the current user.
|
||||
|
||||
```{eval-rst}
|
||||
.. hint::
|
||||
:::{hint}
|
||||
Here is how to stay consistent with the Auth design philosophy for using this feature:
|
||||
1. Use it to display open items that the current user can close by himself only. Do not use it for items, that the user has no control over.
|
||||
2. If there are currently no open items, do not show a badge at all.
|
||||
```
|
||||
|
||||
:::
|
||||
To use it set count the `render()` function of your subclass in accordance to the current user. Here is an example:
|
||||
|
||||
```Python
|
||||
|
||||
Reference in New Issue
Block a user