Skip to content

Commit

Permalink
reset_visit_code_sequence_for_subject in view mixin, remove refs to b…
Browse files Browse the repository at this point in the history
…ootstrap3 template folder
  • Loading branch information
erikvw committed Jan 20, 2025
1 parent f56578f commit a7cb7a1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
6 changes: 1 addition & 5 deletions edc_visit_schedule/templatetags/edc_visit_schedule_extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
from django import template
from django.core.exceptions import ObjectDoesNotExist
from django.utils.html import format_html
from edc_dashboard.utils import get_bootstrap_version

from ..models import SubjectScheduleHistory

register = template.Library()


@register.inclusion_tag(
f"edc_visit_schedule/bootstrap{get_bootstrap_version()}/"
f"subject_schedule_footer_row.html"
)
@register.inclusion_tag("edc_visit_schedule/subject_schedule_footer_row.html")
def subject_schedule_footer_row(
subject_identifier, visit_schedule, schedule, subject_dashboard_url
):
Expand Down
7 changes: 7 additions & 0 deletions edc_visit_schedule/view_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import TYPE_CHECKING, Any

from django.core.exceptions import ObjectDoesNotExist
from edc_appointment.utils import reset_visit_code_sequence_for_subject
from edc_utils import get_utcnow

from .site_visit_schedules import site_visit_schedules
Expand Down Expand Up @@ -42,6 +43,12 @@ def get_context_data(self, **kwargs) -> dict[str, Any]:
self.current_schedule = schedule
self.current_visit_schedule = visit_schedule
self.current_onschedule_model = onschedule_model_obj
reset_visit_code_sequence_for_subject(
subject_identifier=self.subject_identifier,
visit_schedule_name=self.current_visit_schedule.name,
schedule_name=self.current_schedule.name,
)

kwargs.update(
visit_schedules=self.visit_schedules,
current_onschedule_model=self.current_onschedule_model,
Expand Down
3 changes: 1 addition & 2 deletions edc_visit_schedule/views/home_view.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from django.views.generic.base import TemplateView
from edc_dashboard.utils import get_bootstrap_version
from edc_dashboard.view_mixins import EdcViewMixin
from edc_navbar.view_mixin import NavbarViewMixin


class HomeView(EdcViewMixin, NavbarViewMixin, TemplateView):
template_name = f"edc_visit_schedule/bootstrap{get_bootstrap_version()}/home.html"
template_name = "edc_visit_schedule/home.html"
navbar_name = "edc_visit_schedule"
navbar_selected_item = "visit_schedule"
5 changes: 1 addition & 4 deletions edc_visit_schedule/views/visit_schedule_view.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
from typing import Any

from django.views.generic.base import TemplateView
from edc_dashboard.utils import get_bootstrap_version
from edc_dashboard.view_mixins import EdcViewMixin
from edc_navbar.view_mixin import NavbarViewMixin

from ..site_visit_schedules import SiteVisitScheduleError, site_visit_schedules


class VisitScheduleView(EdcViewMixin, NavbarViewMixin, TemplateView):
template_name = (
f"edc_visit_schedule/bootstrap{get_bootstrap_version()}/visit_schedule.html"
)
template_name = "edc_visit_schedule/visit_schedule.html"
navbar_name = "edc_visit_schedule"
navbar_selected_item = "visit_schedule"

Expand Down

0 comments on commit a7cb7a1

Please sign in to comment.