mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
Docs 202109 (#1067)
* module docstrings * db schema graph * dev docs first pass * dev docs pass 2 * add generated notification to top of generated docs files * linting * regen docs Co-authored-by: Stefan Pratter <stefan@20c.com> Co-authored-by: Sunshine Buchholz <sunshine@20c.com>
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
"""
|
||||
Django signal handlers
|
||||
|
||||
- org usergroup creation
|
||||
- entity count updates (fac_count, net_count etc.)
|
||||
- geocode when address model (org, fac) is saved
|
||||
- verification queue creation on new objects
|
||||
- asn rdap automation to automatically grant org / network to user
|
||||
- user to org affiliation handling when targeted org has no users
|
||||
- notify admin-com
|
||||
- CORS enabling for GET api requests
|
||||
|
||||
"""
|
||||
|
||||
from datetime import datetime, timezone
|
||||
|
||||
import django.urls
|
||||
@@ -130,7 +144,7 @@ reversion.signals.post_revision_commit.connect(connector_objects_post_revision_c
|
||||
def addressmodel_save(sender, instance=None, **kwargs):
|
||||
"""
|
||||
Mark address model objects for geocode sync if one of the address
|
||||
fields is updated
|
||||
fields is updated.
|
||||
"""
|
||||
|
||||
if instance.id:
|
||||
@@ -152,8 +166,8 @@ pre_save.connect(addressmodel_save, sender=Facility)
|
||||
|
||||
def org_save(sender, **kwargs):
|
||||
"""
|
||||
we want to create a user group for an organization when that
|
||||
organization is created
|
||||
Create a user group for an organization when that
|
||||
organization is created.
|
||||
"""
|
||||
|
||||
inst = kwargs.get("instance")
|
||||
@@ -220,8 +234,8 @@ post_save.connect(org_save, sender=Organization)
|
||||
|
||||
def org_delete(sender, instance, **kwargs):
|
||||
"""
|
||||
When an organization is HARD deleted we want to also remove any
|
||||
usergroups tied to the organization
|
||||
When an organization is HARD deleted, remove any
|
||||
usergroups tied to the organization.
|
||||
"""
|
||||
|
||||
try:
|
||||
@@ -245,11 +259,10 @@ pre_delete.connect(org_delete, sender=Organization)
|
||||
def new_user_to_guests(request, user, sociallogin=None, **kwargs):
|
||||
"""
|
||||
When a user is created via oauth login put them in the guest
|
||||
group for now.
|
||||
group temporarily.
|
||||
|
||||
Unless pdb_settings.AUTO_VERIFY_USERS is toggled on in settings, in which
|
||||
case users get automatically verified (note that this does
|
||||
not include email verification, they will still need to do that)
|
||||
If pdb_settings.AUTO_VERIFY_USERS is toggled on in the settings, users get automatically verified (Note: this does
|
||||
not include email verification, they will still need to do that).
|
||||
"""
|
||||
|
||||
if pdb_settings.AUTO_VERIFY_USERS:
|
||||
@@ -269,11 +282,10 @@ def recheck_ownership_requests(request, email_address, **kwargs):
|
||||
|
||||
def uoar_creation(sender, instance, created=False, **kwargs):
|
||||
"""
|
||||
When a user to organization affiliation request is created
|
||||
we want to notify the approporiate management entity
|
||||
Notify the approporiate management entity when a user to organization affiliation request is created.
|
||||
|
||||
We also want to attempt to derive the targeted organization
|
||||
from the ASN the user provided
|
||||
Attempt to derive the targeted organization
|
||||
from the ASN the user provided.
|
||||
"""
|
||||
|
||||
if created:
|
||||
|
Reference in New Issue
Block a user