Skip to content

Commit 0c0750a

Browse files
committed
add mappable event types
1 parent 92fbde5 commit 0c0750a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ems_r25/management/commands/ems2r25.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,9 @@ def handle(self, *args, **options):
347347
)
348348
r25_event.title = event_name.strip()
349349
r25_event.state = r25_event.CONFIRMED_STATE
350+
r25_event.event_type_id = settings.EMS_R25_EVENTTYPE_MAP.get(
351+
booking.status.description, settings.EMS_R25_EVENTTYPE_DEFAULT
352+
)
350353

351354
r25_res = r25_event.reservations[0]
352355

ems_r25/more_r25.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,6 @@ def update_event(event):
350350

351351
# initialize some things that aren't kept in the uw_r25 model
352352
update_value(enode, "node_type", "E")
353-
update_value(
354-
enode, "event_type_id", R25_DAO().get_service_setting("EVENTTYPE")
355-
)
356353

357354
onode = enode.xpath("r25:organization", namespaces=nsmap)[0]
358355
update_value(
@@ -377,6 +374,7 @@ def update_event(event):
377374
update_value(enode, "start_date", event.start_date)
378375
update_value(enode, "end_date", event.end_date)
379376
update_value(enode, "state", event.state)
377+
update_value(enode, "event_type_id", event.event_type_id)
380378
update_value(enode, "parent_id", event.parent_id)
381379
update_value(enode, "cabinet_id", event.cabinet_id)
382380
update_value(enode, "cabinet_name", event.cabinet_name)

0 commit comments

Comments
 (0)