Skip to content

Commit

Permalink
update_fields not just fields!
Browse files Browse the repository at this point in the history
  • Loading branch information
tykling authored and zarya committed Nov 10, 2024
1 parent 4b5ef77 commit e30e79a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jobs/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def upload_result(
elif job.job_type == "ImageExifExtractionJob":
exif = json.load(f)
basefile.exif = exif
basefile.save(fields=["exif", "updated"])
basefile.save(update_fields=["exif", "updated"])

Check warning on line 194 in src/jobs/api.py

View check run for this annotation

Codecov / codecov/patch

src/jobs/api.py#L194

Added line #L194 was not covered by tests
else:
logger.debug(f"Unsupported job type: {job.job_type}")
return 500, {"message": "Unsupported job type"}
Expand All @@ -201,7 +201,7 @@ def upload_result(
job.client_uuid = client.client_uuid
job.client_version = client.client_version
job.finished = True
job.save(fields=["user", "client_uuid", "client_version", "finished"])
job.save(update_fields=["user", "client_uuid", "client_version", "finished"])

Check warning on line 204 in src/jobs/api.py

View check run for this annotation

Codecov / codecov/patch

src/jobs/api.py#L204

Added line #L204 was not covered by tests

# refresh basefile to get updated jobcount
basefile.refresh_from_db()
Expand Down

0 comments on commit e30e79a

Please sign in to comment.