Skip to content

Commit

Permalink
Fix: Add missing auto-assign attribute to the applet duplication func…
Browse files Browse the repository at this point in the history
…tion (M2-8150) (#1651)

* Update activity and flows auto-assign base value to false.

* reset values for activity base and flow base.

* Add missing properties to activity and activity flow applet duplicate functions.

* Fix formatting

* Update time value to account for what seems like a daylight savings issue(?).
  • Loading branch information
LashaunnaS authored and mbanting committed Nov 8, 2024
1 parent c03117b commit 00a7c97
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/apps/activities/services/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ async def get_by_applet_id_for_duplicate(self, applet_id: uuid.UUID) -> list[Act
subscale_setting=schema.subscale_setting,
performance_task_type=schema.performance_task_type,
is_performance_task=schema.is_performance_task,
auto_assign=schema.auto_assign,
)
activity_map[activity.id] = activity
activities.append(activity)
Expand Down
1 change: 1 addition & 0 deletions src/apps/activity_flows/service/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ async def get_by_applet_id_duplicate(self, applet_id: uuid.UUID) -> list[FlowDup
hide_badge=schema.hide_badge,
order=schema.order,
is_hidden=schema.is_hidden,
auto_assign=schema.auto_assign,
)
flow_map[flow.id] = flow
flows.append(flow)
Expand Down
2 changes: 2 additions & 0 deletions src/apps/applets/service/applet.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ def _prepare_duplicate(
report_included_item_name=activity.report_included_item_name, # noqa: E501
subscale_setting=activity.subscale_setting,
scores_and_reports=activity.scores_and_reports,
auto_assign=activity.auto_assign,
)
)

Expand All @@ -289,6 +290,7 @@ def _prepare_duplicate(
items=[FlowItemCreate(activity_key=item) for item in activity_flow.activity_ids],
report_included_activity_name=activity_flow.report_included_activity_name, # noqa: E501
report_included_item_name=activity_flow.report_included_item_name, # noqa: E501
auto_assign=activity_flow.auto_assign,
)
)

Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/tests/unit/http/test_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_get_local_tz__exception(headers: list, required: bool, details: str):
(
("UTC", 0),
("EST", -5 * 60 * 60),
("US/Pacific", -7 * 60 * 60),
("US/Pacific", -8 * 60 * 60),
("wrong-timezone", None),
(None, None),
),
Expand Down

0 comments on commit 00a7c97

Please sign in to comment.