Skip to content

Commit f6927f5

Browse files
authored
Merge pull request #265 from BEMServer/async_timezone
AsyncTask: ensure start_dt and end_dt in campaign timezone
2 parents e177f43 + 307a3d7 commit f6927f5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bemserver_core/celery.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class BEMServerCoreAsyncTask(BEMServerCoreClassBasedTaskMixin, Task):
6666
TASK_FUNCTION = None
6767
DEFAULT_PARAMETERS = {}
6868

69-
def run(self, user_id, campaign_id, start_td, end_dt, **kwargs):
69+
def run(self, user_id, campaign_id, start_dt, end_dt, **kwargs):
7070
logger.info("Start")
7171

7272
with OpenBar():
@@ -82,8 +82,8 @@ def run(self, user_id, campaign_id, start_td, end_dt, **kwargs):
8282
# Function is bound at init. Use __func__ to avoid passing self
8383
self.TASK_FUNCTION.__func__(
8484
campaign,
85-
start_td,
86-
end_dt,
85+
start_dt.astimezone(campaign.timezone),
86+
end_dt.astimezone(campaign.timezone),
8787
**{**self.DEFAULT_PARAMETERS, **kwargs},
8888
)
8989

0 commit comments

Comments
 (0)