Skip to content

Commit

Permalink
v11.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
GitRon committed Jul 18, 2024
1 parent 8823497 commit 8586413
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .ambient-package-update/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

METADATA = PackageMetadata(
package_name="ambient_toolbox",
module_name="ambient_toolbox",
github_package_group="ambient-innovation",
company="Ambient Innovation: GmbH",
authors=[
PackageAuthor(
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- name: Run pre-commit hooks
run: pre-commit run --all-files --hook-stage push

validate_migrations:
name: Validate migrations
runs-on: ubuntu-22.04
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
rev: v0.5.2
hooks:
# Run the Ruff linter.
- id: ruff
Expand All @@ -12,7 +12,7 @@ repos:
- id: ruff-format

- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
rev: 1.18.0
hooks:
- id: blacken-docs
additional_dependencies:
Expand All @@ -27,7 +27,7 @@ repos:
stages: [ push ]

- repo: https://github.com/adamchainz/django-upgrade
rev: 1.18.0
rev: 1.19.0
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

**11.0.3** (2024-07-16)
* Added SECURITY.md
* Updated linters
* Internal updates via `ambient-package-update`

**11.0.2** (2024-07-16)
* Fixed GitHub actions bug

Expand Down
18 changes: 18 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Reporting Security Issues

The maintainers of this package take security bugs seriously. We appreciate your efforts to responsibly
disclose your findings, and will make every effort to acknowledge your contributions.

To report a security issue, please use the GitHub Security
Advisory ["Report a Vulnerability"](https://github.com/ambient-innovation/ambient-toolbox/security/advisories/new)
tab.

The maintainers will send a response indicating the next steps in handling your report. After the initial reply to
your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask
for additional information or guidance.

Report security bugs in third-party modules to the person or team maintaining the module.

## Source

This file was inspired by: https://github.com/electron/electron/blob/main/SECURITY.md
2 changes: 1 addition & 1 deletion ambient_toolbox/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Python toolbox of Ambient Digital containing an abundance of useful tools and gadgets."""

__version__ = "11.0.2"
__version__ = "11.0.3"
3 changes: 1 addition & 2 deletions ambient_toolbox/tests/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ def get_request(
request = factory.get(url)

# Set user object if it is of a valid type
# TODO: remove noqa when we drop older python support
if user is None or isinstance(user, AbstractBaseUser) or isinstance(user, AnonymousUser): # noqa: PLR1701
if user is None or isinstance(user, AbstractBaseUser) or isinstance(user, AnonymousUser):
request.user = user
else:
raise ValueError(_("Please pass a user object to RequestProviderMixin."))
Expand Down
7 changes: 2 additions & 5 deletions ambient_toolbox/utils/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,15 @@ def object_to_dict(obj, blacklisted_fields: Optional[list] = None, include_id: b
blacklisted_fields.append("id")

data = vars(obj)
valid_data = {}

valid_fields = []
for f in obj.__class__._meta.get_fields():
if type(f) != ForeignKey:
if not isinstance(f, ForeignKey):
valid_fields.append(f.name)
else:
valid_fields.append(f"{f.name}_id")

for key, value in list(data.items()):
if key in valid_fields and key not in blacklisted_fields:
valid_data[key] = value
valid_data = {key: value for key, value in data.items() if key in valid_fields and key not in blacklisted_fields}

return valid_data

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dev = [
'mistune<2.0.0',
'flit~=3.9',
'keyring~=25.2',
'ambient-package-update~=24.7.6',
'ambient-package-update',
'gevent~=23.9',
'httpx~=0.27',
]
Expand Down

0 comments on commit 8586413

Please sign in to comment.