Skip to content
Snippets Groups Projects
Commit 24f73b60 authored by Jonas Braathen's avatar Jonas Braathen
Browse files

Fix typing and linting errors

parent 6ef7aab0
No related branches found
No related tags found
1 merge request!115Greg 86 notification format changes
Pipeline #97589 passed
......@@ -49,7 +49,6 @@ def create_cloud_event_payload(n: Notification) -> str:
and source, i.e no.local.greg.person.add
"""
object_type = camel_to_snake(n.object_type)
content: dict[str, Union[str, dict[str, str]]] = {
"id": str(n.id),
"source": f"greg:{settings.INSTANCE_NAME}:{settings.ENVIRONMENT}",
......
......@@ -10,6 +10,7 @@ from greg.schedule import ExpiringRolesNotification
logging.config.dictConfig(settings.LOGGING)
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""
This command starts a basic task runner. All tasks it is supposed to
......
import time
import logging
from typing import Dict
from typing import Dict, Union
from django.db import models
from django.dispatch import receiver
......@@ -165,8 +165,8 @@ def m2m_changed_notification_callback(
)
def _create_metadata(instance) -> Dict:
meta = {}
def _create_metadata(instance) -> Dict[str, Union[int, str]]:
meta: Dict[str, Union[int, str]] = {}
if isinstance(instance, Person):
meta["person_id"] = instance.id
elif isinstance(instance, Role):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment