Skip to content

Commit

Permalink
Manually register reason for contacting export task
Browse files Browse the repository at this point in the history
  • Loading branch information
said-moj committed Aug 9, 2023
1 parent 9477585 commit bd0a844
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cla_backend/apps/reports/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,15 @@ 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"

def run(self, user_id, filename, form_class_name, post_data, *args, **kwargs):
"""
Export csv files for each of the referrers from reason for contacting
Expand Down Expand Up @@ -228,3 +233,9 @@ def generate_rfc_zip(self):
with ZipFile(self.filepath, "w") as refer_zip:
for csv_file in glob.glob("*.csv"):
refer_zip.write(csv_file)


# 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())

0 comments on commit bd0a844

Please sign in to comment.