Skip to content

Commit

Permalink
Merge 8d77c92 into 03fe6ae
Browse files Browse the repository at this point in the history
  • Loading branch information
GDay authored Oct 17, 2023
2 parents 03fe6ae + 8d77c92 commit 864627b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions back/admin/integrations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@ def clean(self):
raise ValidationError({"manifest": json.dumps(manifest_serializer.errors)})

def save(self, *args, **kwargs):
# avoid circular import
from admin.integrations.tasks import sync_user_info

super().save(*args, **kwargs)
# update the background job based on the manifest
schedule_cron = self.manifest.get("schedule")
Expand All @@ -149,7 +146,7 @@ def save(self, *args, **kwargs):
# Schedule does not exist yet, so create it if specified
if schedule_cron:
schedule(
sync_user_info,
"admin.integrations.tasks.sync_user_info",
self.id,
schedule_type=Schedule.CRON,
cron=schedule_cron,
Expand Down Expand Up @@ -424,7 +421,7 @@ def execute(self, new_hire=None, params=None):
self.params["files"][save_as_file] = io.BytesIO(response.content)

# save json response temporarily to be reused in other parts
if save_as_file is None:
if save_as_file is None and not isinstance(response, str):
self.params["responses"].append(response.json())
else:
# if we save a file, then just append an empty dict
Expand Down

0 comments on commit 864627b

Please sign in to comment.