From d5bb93a0e77c704bd28abece4216fe119570cd65 Mon Sep 17 00:00:00 2001 From: Ernesto Rico Schmidt <ernesto@helsinki.at> Date: Tue, 9 Jul 2024 12:00:51 -0400 Subject: [PATCH] feat: update utils Host -> Profile --- program/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/program/utils.py b/program/utils.py index 9ef4f225..8b7ff497 100644 --- a/program/utils.py +++ b/program/utils.py @@ -30,9 +30,9 @@ from django.utils import timezone from program.typing import Link if typing.TYPE_CHECKING: - from program.models import Host, HostLink, Note, NoteLink, Show, ShowLink + from program.models import Note, NoteLink, Profile, ProfileLink, Show, ShowLink else: - from program.models import Host, HostLink, Note, NoteLink, Show, ShowLink + from program.models import Note, NoteLink, Profile, ProfileLink, Show, ShowLink def parse_datetime(date_string: str | None) -> datetime | None: @@ -138,8 +138,8 @@ def get_values( def update_links( - instance: Union["Host", "Note", "Show"], links: list[Link] -) -> Union["Host", "Note", "Show"]: + instance: Union["Profile", "Note", "Show"], links: list[Link] +) -> Union["Profile", "Note", "Show"]: """Update the links associated with the instance""" # delete the links associated with the instance @@ -147,9 +147,9 @@ def update_links( for link in instance.links.all(): link.delete(keep_parents=True) - if isinstance(instance, Host): + if isinstance(instance, Profile): for link_data in links: - HostLink.objects.create(host=instance, **link_data) + ProfileLink.objects.create(profile=instance, **link_data) if isinstance(instance, Note): for link_data in links: -- GitLab