Skip to content
This repository has been archived by the owner on Apr 16, 2023. It is now read-only.

Commit

Permalink
Merge branch 'dev' into predict-app
Browse files Browse the repository at this point in the history
  • Loading branch information
DigitalPhilosopher committed Oct 18, 2019
2 parents 74ed977 + 555758e commit 9e3ec64
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Feel free to open a PR before all of these items have been completed.

Pull Request Checklist
- [ ] Pull request has been made against `dev` branch.
- [ ] Pull request includes a description of the change and the reason behind it.
- [ ] Pull request [uses keywords](https://help.github.com/en/articles/closing-issues-using-keywords) to close relevant [issues](https://github.com/uptake/autofocus/issues).
- [ ] Pull request includes unit tests for any new functionality.
Expand All @@ -11,4 +12,4 @@ Maintainer's responsibilities:
- [ ] `_version.py` has been updated.
- [ ] `CHANGELOG.md` has been updated.
- [ ] Updated app container has been pushed, if relevant, with current version number.
- [ ] App container version number has been updated in README.
- [ ] App container version number has been updated everywhere in README.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

# [1.2.4] - 2019-10-13
### Changed
- Service gets image file extensions from `mimetypes` instead of using a hard-coded list.

# [1.2.3] - 2019-8-22
### Changed
- Tests and instructions now refer to "localhost" instead of "0.0.0.0".
Expand Down
2 changes: 1 addition & 1 deletion autofocus/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.2.2"
__version__ = "1.2.4"
7 changes: 5 additions & 2 deletions autofocus/predict/app/requests/Validator.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import mimetypes
from abc import ABC, abstractmethod

from flask import abort, jsonify, make_response
from flask_api import status


ALLOWED_IMAGE_FILES = set(["png", "jpg", "jpeg", "gif", "bmp"])
ALLOWED_ZIP_FILES = {"zip"}
ALLOWED_IMAGE_FILES = set(
k for k, v in mimetypes.types_map.items() if v.startswith("image/")
)
ALLOWED_ZIP_FILES = {".zip"}


class Validator(ABC):
Expand Down
2 changes: 1 addition & 1 deletion autofocus/predict/app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ def allowed_file(filename, allowed_extensions):
bool: whether the filename is in allowed extensions
"""
return Path(filename).suffix.lower().replace(".", "") in allowed_extensions
return Path(filename).suffix.lower() in allowed_extensions
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
extras_require={"dev": regular_packages + dev_packages},
author="Greg Gandenberger",
author_email="[email protected]",
url="https://github.com/UptakeOpenSource/autofocus",
url="https://github.com/uptake/autofocus",
long_description_content_type="text/markdown",
)

0 comments on commit 9e3ec64

Please sign in to comment.