Skip to content

Commit

Permalink
Merge pull request #49 from cloudblue/LITE-30582-upload-issue-with-bi…
Browse files Browse the repository at this point in the history
…g-files

LITE-30582 Fix add with next verbose all error
  • Loading branch information
akodelia authored Aug 9, 2024
2 parents d9756d5 + e9763a3 commit 3843454
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions connect_bi_reporter/uploads/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,19 @@ def create_uploads(db, client, logger, feeds):
feed_id=feed.id,
report_id=report_file['id'],
))
created_uploads = []
if uploads:
db.add_all_with_next_verbose(uploads, related_id_field=Upload.feed_id.name)
db.flush()
uploads_info = ', '.join('Upload={0} for Feed={1}'.format(u.id, u.feed_id) for u in uploads)
for up in uploads:
db.add_next_with_verbose(up, related_id_field=Upload.feed_id.name)
db.commit()
db.refresh(up)
created_uploads.append(up)
uploads_info = ', '.join(
'Upload={0} for Feed={1}'.format(u.id, u.feed_id) for u in created_uploads
)
logger.info(Info.new_upload_created.format(uploads_info=uploads_info))
disable_feeds(db, feeds_to_disable, logger)
return uploads
return created_uploads


def get_process_upload_task_payload(installation_id, upload_id, account_id):
Expand Down

0 comments on commit 3843454

Please sign in to comment.