Skip to content

Commit

Permalink
Set name of default export task
Browse files Browse the repository at this point in the history
  • Loading branch information
said-moj committed Aug 9, 2023
1 parent bd0a844 commit f2cb7e1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cla_backend/apps/reports/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def send_to_s3(self):


class ExportTask(ExportTaskBase):
name = "exporttask"

def run(self, user_id, filename, form_class_name, post_data, *args, **kwargs):
self.user = User.objects.get(pk=user_id)
self._create_export()
Expand Down Expand Up @@ -153,12 +155,6 @@ def run(self, user_id, filename, form_class_name, post_data, *args, **kwargs):
pass


# The Task base class no longer automatically register tasks
# https://docs.celeryq.dev/en/v4.0.0/whatsnew-4.0.html#the-task-base-class-no-longer-automatically-register-tasks
# https://github.com/celery/celery/issues/5992
app.tasks.register(OBIEEExportTask())


class ReasonForContactingExportTask(ExportTaskBase):
name = "reasonforcontactingexport"

Expand Down Expand Up @@ -238,4 +234,6 @@ def generate_rfc_zip(self):
# The Task base class no longer automatically register tasks
# https://docs.celeryq.dev/en/v4.0.0/whatsnew-4.0.html#the-task-base-class-no-longer-automatically-register-tasks
# https://github.com/celery/celery/issues/5992
app.tasks.register(ReasonForContactingExportTask())
tasks = [ExportTask, OBIEEExportTask(), ReasonForContactingExportTask()]
for task in tasks:
app.tasks.register(task)

0 comments on commit f2cb7e1

Please sign in to comment.