Skip to content

Commit

Permalink
Update image bkg path when not originally provided
Browse files Browse the repository at this point in the history
If an image is loaded from the DB and the background_path is not defined but it is defined in the current run, the path is updated and saved to the DB.

Fixes #341.
  • Loading branch information
ajstewart committed Oct 7, 2020
1 parent a522d38 commit 29ac1d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
## [Unreleased](https://github.com/askap-vast/vast-pipeline/compare/0.1.0...HEAD)

#### Added
- Updates image `background_path` from current run when not originally provided [#377](https://github.com/askap-vast/vast-pipeline/pull/377).
- Fills out information on all webinterface detail pages [#345](https://github.com/askap-vast/vast-pipeline/pull/345).
- Adds frequency information the measurements and images webinterface tables. [#345](https://github.com/askap-vast/vast-pipeline/pull/345).
- Adds celestial plot and tables to webinterface pipeline detail page [#345](https://github.com/askap-vast/vast-pipeline/pull/345).
Expand Down Expand Up @@ -33,6 +34,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Removed `static/css/collapse-box.css`, content moved to `pipeline.css` [#345](https://github.com/askap-vast/vast-pipeline/pull/345).

#### List of PRs
- [#377](https://github.com/askap-vast/vast-pipeline/pull/377) fix: Update image bkg path when not originally provided.
- [#372](https://github.com/askap-vast/vast-pipeline/pull/372) fix: fix social auth scope setting name.
- [#345](https://github.com/askap-vast/vast-pipeline/pull/345) feat, fix: Website improvements.

Expand Down
4 changes: 4 additions & 0 deletions vast_pipeline/pipeline/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def get_create_img(p_run, band_id, image):
img = Image.objects.filter(name__exact=image.name)
if img.exists():
img = img.get()
# Add background path if not originally provided
if image.background_path and not img.background_path:
img.background_path = image.background_path
img.save()
skyreg = get_create_skyreg(p_run, img)
# check and add the many to many if not existent
if not Image.objects.filter(
Expand Down

0 comments on commit 29ac1d9

Please sign in to comment.