Skip to content

Commit

Permalink
Merge branch 'ziotom78:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ziotom78 authored Nov 2, 2023
2 parents 0fdd1fb + 934f982 commit 06a789c
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 235 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# HEAD

- Add the variable `CSRF_TRUSTED_ORIGINS` to the list of fields in the `.env` file [#115](https://github.com/ziotom78/instrumentdb/pull/115)
- Return more useful errors when wrong paths are used [#121](https://github.com/ziotom78/instrumentdb/pull/121)

# Version 2.0.0

- **Breaking change** Add the variable `CSRF_TRUSTED_ORIGINS` to the list of required fields in the `.env` file [#115](https://github.com/ziotom78/instrumentdb/pull/115)

- Remove limit in number of fields within a POST request [#114](https://github.com/ziotom78/instrumentdb/pull/114)

Expand Down
13 changes: 1 addition & 12 deletions browse/management/commands/updatedb.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
# -*- encoding: utf-8 -*-
import time
from pathlib import Path
import json
from uuid import UUID

from django.core.files import File
from django.utils.dateparse import parse_datetime
from django.utils.timezone import is_aware, make_aware
from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import BaseCommand
from browse.models import (
Entity,
Quantity,
DataFile,
FormatSpecification,
Release,
update_release_file_dumps,
)

Expand Down
7 changes: 5 additions & 2 deletions browse/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,11 @@ def navigate_tree_of_entities(url_components: List[str]) -> Entity:
if len(url_components) == 1:
return cur_obj

for comp in url_components[1:-1]:
cur_obj = get_object_or_404(cur_obj.get_children(), name=comp)
try:
for comp in url_components[1:-1]:
cur_obj = cur_obj.get_children().get(name=comp)
except (Entity.DoesNotExist, AttributeError):
raise ValueError("Invalid path {}".format("/".join(url_components)))

last_name = url_components[-1]
if last_name.endswith("/"):
Expand Down
2 changes: 1 addition & 1 deletion instrumentdb/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "1.1.0"
__version__ = "2.0.0"
1 change: 0 additions & 1 deletion instrumentdb/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from pathlib import Path
import os

from django.conf import settings
from envparse import Env

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
Expand Down
443 changes: 228 additions & 215 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "instrumentdb"
version = "1.1.0"
version = "2.0.0"
description = ""
authors = ["Maurizio Tomasi <[email protected]>"]

Expand All @@ -14,7 +14,7 @@ django-filter = "^2.2.0"
pyyaml = "^6.0.0"
django-mptt = "^0.14.0"
drf-yasg = "^1.21.7"
gitpython = "^3.1.35"
gitpython = "^3.1.37"
envparse = "^0.2.0"
sphinx = "^5.1.1"
django-sslserver = "^0.22"
Expand Down
1 change: 0 additions & 1 deletion tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from pathlib import Path
from tempfile import TemporaryDirectory

from django.core.files import File
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.management import call_command
from django.test import TestCase
Expand Down

0 comments on commit 06a789c

Please sign in to comment.