Compare commits

..

1 Commits

Author SHA1 Message Date
af13990356 chore(deps): update dependency sass to v1.83.0
All checks were successful
Ruff / ruff (push) Successful in 41s
Ruff / ruff (pull_request) Successful in 43s
Test / test (push) Successful in 11m46s
Test / test (pull_request) Successful in 11m47s
2024-12-12 22:45:59 +00:00
8 changed files with 16 additions and 45 deletions

View File

@ -149,12 +149,7 @@ def sync_members(access_client: AccessClient):
if access_user := access_users_by_employee_number.get(member.uid):
expected_user["status"] = (
UserStatus.ACTIVE
if (
member.is_active
or member.flags.filter(name="Misc. Access", type="folder").exists()
)
else UserStatus.DEACTIVATED
UserStatus.ACTIVE if member.is_active else UserStatus.DEACTIVATED
)
changes = {
k: v for k, v in expected_user.items() if getattr(access_user, k) != v

View File

@ -402,7 +402,7 @@ class AssignNfcCardStatus(BaseModel):
class AssignNfcCardView(PermissionRequiredMixin, TemplateView):
# for storage in request.session
ENROLLMENT_STATUS_SESSION_KEY = "unifi_access_enrollment_status"
permission_required = "doorcontrol.assign_nfc_card"
requires_permission = "doorcontrol.assign_nfc_card"
template_name = "doorcontrol/assign_nfc_card.dj.html"
def get_template_names(self) -> list[str]:

View File

@ -4,6 +4,7 @@ from datetime import datetime, timedelta
from django.conf import settings
from django.db import transaction
from django.db.models import QuerySet
from cmsmanage.django_q2_helper import q_task_group
from membershipworks.membershipworks_api import FieldType, MembershipWorks
@ -124,13 +125,13 @@ def scrape_membershipworks(*args, **options):
scrape_transactions(membershipworks)
def scrape_event_details(events: Iterable[EventExt]):
def scrape_event_details(queryset: QuerySet[EventExt]):
membershipworks = MembershipWorks()
membershipworks.login(
settings.MEMBERSHIPWORKS_USERNAME, settings.MEMBERSHIPWORKS_PASSWORD
)
for event in events:
for event in queryset:
event.details = membershipworks.get_event_by_eid(event.eid)
event.registrations = membershipworks.get_event_registrations(event.eid)
event.save()

View File

@ -1,10 +0,0 @@
<a class="btn btn-sm btn-primary"
hx-boost="true"
hx-push-url="false"
hx-indicator=".htmx-indicator"
href="{% querystring refresh=1 %}">
<div class="spinner-border spinner-border-sm htmx-indicator" role="status">
<span class="visually-hidden">Loading...</span>
</div>
Refresh Data
</a>

View File

@ -13,16 +13,10 @@
{% endblock %}
{% block content %}
<div class="container">
<div class="row justify-content-center d-print-none">
<div class="col-auto">
{% if event.registrations is not None %}
{% url 'membershipworks:event-registrations' event.pk as registrations_url %}
{% bootstrap_button extra_classes="btn-sm" href=registrations_url content="Show Registrations" %}
{% endif %}
</div>
<div class="col-auto">{% include "membershipworks/components/refresh_data_button.dj.html" %}</div>
</div>
{% if event.registrations is not None %}
{% url 'membershipworks:event-registrations' event.pk as registrations_url %}
{% bootstrap_button href=registrations_url content="Show Registrations" %}
{% endif %}
{% include "membershipworks/event_invoice.dj.html" %}
<div class="card w-auto mt-5">

View File

@ -22,7 +22,6 @@
{% bootstrap_button extra_classes="btn-sm" href=email_link target="_blank" content="Email all attendees" %}
</div>
<div class="col-auto">{% include "cmsmanage/components/download_table.dj.html" %}</div>
<div class="col-auto">{% include "membershipworks/components/refresh_data_button.dj.html" %}</div>
</div>
<h2 class="d-none d-print-block">Registrations for {{ event.details.ttl|nh3 }}</h2>
{% render_table table %}

View File

@ -41,7 +41,6 @@ from django_weasyprint import WeasyTemplateResponseMixin
from django_weasyprint.utils import django_url_fetcher
from membershipworks.membershipworks_api import MembershipWorks
from membershipworks.tasks.scrape import scrape_event_details, scrape_events
from .forms import EventInvoiceForm
from .invoice_email import make_invoice_emails
@ -311,10 +310,6 @@ class EventDetailView(
if self.request.user.has_perm(
self.permission_required
) or self.object.user_is_instructor(self.request.user):
if "refresh" in self.request.GET:
scrape_events()
scrape_event_details([self.object])
return super().render_to_response(context, **response_kwargs)
else:
return self.handle_no_permission()
@ -458,9 +453,6 @@ class EventRegistrationsView(ExportMixin, SingleTableMixin, AccessMixin, DetailV
def render_to_response(
self, context: dict[str, Any], **response_kwargs: Any
) -> HttpResponse:
if "refresh" in self.request.GET:
scrape_event_details([self.object])
if self.request.user.has_perm(
self.permission_required
) or self.object.user_is_instructor(self.request.user):

14
pnpm-lock.yaml generated
View File

@ -41,13 +41,13 @@ importers:
version: 3.4.2
sass:
specifier: ^1.82.0
version: 1.82.0
version: 1.83.0
typescript:
specifier: ^5.7.2
version: 5.7.2
vite:
specifier: ^6.0.3
version: 6.0.3(sass@1.82.0)
version: 6.0.3(sass@1.83.0)
packages:
@ -528,8 +528,8 @@ packages:
run-parallel@1.2.0:
resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
sass@1.82.0:
resolution: {integrity: sha512-j4GMCTa8elGyN9A7x7bEglx0VgSpNUG4W4wNedQ33wSMdnkqQCT8HTwOaVSV4e6yQovcu/3Oc4coJP/l0xhL2Q==}
sass@1.83.0:
resolution: {integrity: sha512-qsSxlayzoOjdvXMVLkzF84DJFc2HZEL/rFyGIKbbilYtAvlCxyuzUeff9LawTn4btVnLKg75Z8MMr1lxU1lfGw==}
engines: {node: '>=14.0.0'}
hasBin: true
@ -966,7 +966,7 @@ snapshots:
dependencies:
queue-microtask: 1.2.3
sass@1.82.0:
sass@1.83.0:
dependencies:
chokidar: 4.0.1
immutable: 5.0.3
@ -988,11 +988,11 @@ snapshots:
unicorn-magic@0.1.0: {}
vite@6.0.3(sass@1.82.0):
vite@6.0.3(sass@1.83.0):
dependencies:
esbuild: 0.24.0
postcss: 8.4.49
rollup: 4.28.0
optionalDependencies:
fsevents: 2.3.3
sass: 1.82.0
sass: 1.83.0