Skip to content

Commit

Permalink
Merge branch 'dev' into feature/integration_point_buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
jchate6 committed Nov 27, 2023
2 parents 43ff567 + 88a6bbf commit 84e6412
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 59 deletions.
109 changes: 56 additions & 53 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ classifiers = [
python = ">=3.8.1,<3.12"
numpy = "~1.24,<2"
astroquery = "<1"
astroplan = "~0.8"
astroplan = ">=0.8,<0.10"
astropy = ">=3,<6"
django = "<5"
djangorestframework = "<4"
Expand All @@ -78,20 +78,20 @@ requests = "<3"
specutils = "<2"

[tool.poetry.group.test.dependencies]
responses = "~0.23"
responses = ">=0.23,<0.25"
factory_boy = ">3.2.1,<3.4"

[tool.poetry.group.docs.dependencies]
recommonmark = "~0.7"
sphinx = ">=4,<8"
sphinx-rtd-theme = "~1.0"
sphinx-rtd-theme = ">=1.0,<1.4"

[tool.poetry.group.coverage.dependencies]
coverage = "~6" # coveralls needs ~6 even though 7.3.2 is latest
coveralls = "~3"

[tool.poetry.group.lint.dependencies]
flake8 = "~6.0"
flake8 = ">=6.0,<6.2"

[tool.poetry-dynamic-versioning]
enable = true
Expand Down
6 changes: 5 additions & 1 deletion tom_dataproducts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ def get_preview(self, size=THUMBNAIL_DEFAULT_SIZE, redraw=False):
"""
if self.thumbnail:
im = Image.open(self.thumbnail)
if im.size != THUMBNAIL_DEFAULT_SIZE:
if im.size != THUMBNAIL_DEFAULT_SIZE and im.size[0] not in THUMBNAIL_DEFAULT_SIZE:
redraw = True
logger.critical("Redrawing thumbnail for {0} due to size mismatch".format(im.size))

if not self.thumbnail or redraw:
width, height = THUMBNAIL_DEFAULT_SIZE
Expand All @@ -262,6 +263,9 @@ def create_thumbnail(self, width=None, height=None):
:returns: Thumbnail file if created, None otherwise
:rtype: file
"""
if not self.data:
logger.error(f'Unable to create thumbnail for {self}: No data file found.')
return
if is_fits_image_file(self.data.file):
tmpfile = tempfile.NamedTemporaryFile(suffix='.jpg')
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% endif %}
</a></td>
<td>{{ product.created }}</td>
<td><a href="{% url 'tom_dataproducts:delete' product.id %}" class="btnbtn-danger">Delete</a></td>
<td><a href="{% url 'tom_dataproducts:delete' product.id %}" class="btn btn-danger">Delete</a></td>
</tr>
{% empty %}
<tr>
Expand Down

0 comments on commit 84e6412

Please sign in to comment.