Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ jobs:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v7
with:
version: "0.5.6"
version: "0.9.29"

- name: Run ruff
working-directory: backend
run: |
uvx ruff check src/ ../premium/backend/src/ ../enterprise/backend/src/ tests/ ../premium/backend/tests/ ../enterprise/backend/tests/
uvx ruff format --check src/ ../premium/backend/src/ ../enterprise/backend/src/ tests/ ../premium/backend/tests/ ../enterprise/backend/tests/
uv run ruff check src/ ../premium/backend/src/ ../enterprise/backend/src/ tests/ ../premium/backend/tests/ ../enterprise/backend/tests/
uv run ruff format --check src/ ../premium/backend/src/ ../enterprise/backend/src/ tests/ ../premium/backend/tests/ ../enterprise/backend/tests/

frontend-lint:
name: Web-Frontend Lint
Expand Down
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dynamic = ["version"]
classifiers = []

dependencies = [
"django==5.2.10",
"django==5.2.11",
"django-cors-headers==4.9.0",
"djangorestframework==3.16.1",
"djangorestframework-simplejwt==5.5.1",
Expand Down
5 changes: 5 additions & 0 deletions backend/src/baserow/contrib/database/api/fields/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,8 @@
HTTP_400_BAD_REQUEST,
"Cannot set this constraint when default value is set.",
)
ERROR_VIEW_NOT_SUPPORTED = (
"ERROR_VIEW_NOT_SUPPORTED",
HTTP_400_BAD_REQUEST,
"Cannot use the view type.",
)
3 changes: 3 additions & 0 deletions backend/src/baserow/contrib/database/api/fields/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
ERROR_RESERVED_BASEROW_FIELD_NAME,
ERROR_SELECT_OPTION_DOES_NOT_BELONG_TO_FIELD,
ERROR_TABLE_HAS_NO_PRIMARY_FIELD,
ERROR_VIEW_NOT_SUPPORTED,
)
from baserow.contrib.database.api.rows.errors import ERROR_ROW_DOES_NOT_EXIST
from baserow.contrib.database.api.tables.errors import (
Expand Down Expand Up @@ -118,6 +119,7 @@
from baserow.contrib.database.table.handler import TableHandler
from baserow.contrib.database.tokens.exceptions import NoPermissionToTable
from baserow.contrib.database.tokens.handler import TokenHandler
from baserow.contrib.database.views.exceptions import ViewDoesNotSupportListingRows
from baserow.core.action.registries import action_type_registry
from baserow.core.db import atomic_with_retry_on_deadlock, specific_iterator
from baserow.core.exceptions import UserNotInWorkspace
Expand Down Expand Up @@ -295,6 +297,7 @@ def get(self, request, table_id):
InvalidFieldConstraint: ERROR_INVALID_FIELD_CONSTRAINT,
ImmutableFieldProperties: ERROR_IMMUTABLE_FIELD_PROPERTIES,
FieldConstraintDoesNotSupportDefaultValueError: ERROR_FIELD_CONSTRAINT_DOES_NOT_SUPPORT_DEFAULT_VALUE,
ViewDoesNotSupportListingRows: ERROR_VIEW_NOT_SUPPORTED,
}
)
def post(self, request, data, table_id):
Expand Down
4 changes: 3 additions & 1 deletion backend/src/baserow/contrib/database/fields/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,9 @@ def update_field(
from_field_type.can_have_select_options
and not to_field_type.can_have_select_options
):
SelectOption.objects.filter(field_id=field.id).delete()
SelectOption.objects.filter(field_id=field.id)._raw_delete(
using=DEFAULT_DB_ALIAS
)

to_field_type.after_update(
old_field,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1840,3 +1840,25 @@ def test_lookup_field_type(api_client, data_fixture):
response_json = response.json()
assert response.status_code == HTTP_400_BAD_REQUEST
assert response_json["error"] == "ERROR_REQUEST_BODY_VALIDATION"


@pytest.mark.django_db
def test_autonumber_field_type_create_fails_form_view(api_client, data_fixture):
user, token = data_fixture.create_user_and_token()
table = data_fixture.create_database_table(user=user)
view = data_fixture.create_form_view(user=user, table=table)

response = api_client.post(
reverse("api:database:fields:list", kwargs={"table_id": table.id}),
{
"name": "autonumber_field",
"type": "autonumber",
"view_id": view.id,
},
format="json",
HTTP_AUTHORIZATION=f"JWT {token}",
)

response_json = response.json()
assert response.status_code == HTTP_400_BAD_REQUEST, response_json
assert response_json["error"] == "ERROR_VIEW_NOT_SUPPORTED"
22 changes: 11 additions & 11 deletions backend/uv.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@
</ul>
<ul class="tree">
<li
v-for="(applicationGroup, index) in groupedApplicationsForSelectedWorkspace"
v-for="(
applicationGroup, index
) in groupedApplicationsForSelectedWorkspace"
:key="applicationGroup.type"
>
<div class="tree__heading" :class="{'margin-bottom-2': applicationGroup.applications.length === 0 && index < groupedApplicationsForSelectedWorkspace.length - 1}">
<div
class="tree__heading"
:class="{
'margin-bottom-2':
applicationGroup.applications.length === 0 &&
index < groupedApplicationsForSelectedWorkspace.length - 1,
}"
>
<div class="tree__heading-name">
{{ applicationGroup.name }}
</div>
Expand Down Expand Up @@ -73,7 +82,10 @@
>
</component>
</ul>
<div v-if="index < groupedApplicationsForSelectedWorkspace.length - 1" class="tree__separator"></div>
<div
v-if="index < groupedApplicationsForSelectedWorkspace.length - 1"
class="tree__separator"
></div>
</li>
</ul>
</div>
Expand Down
37 changes: 31 additions & 6 deletions web-frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1038,9 +1038,9 @@
integrity sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==

"@isaacs/brace-expansion@^5.0.0":
version "5.0.0"
resolved "https://registry.yarnpkg.com/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz#4b3dabab7d8e75a429414a96bd67bf4c1d13e0f3"
integrity sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==
version "5.0.1"
resolved "https://registry.yarnpkg.com/@isaacs/brace-expansion/-/brace-expansion-5.0.1.tgz#0ef5a92d91f2fff2a37646ce54da9e5f599f6eff"
integrity sha512-WMz71T1JS624nWj2n2fnYAuPovhv7EUhk69R6i9dsVyzxt5eM3bjwvgk9L+APE1TRscGysAVMANkB0jh0LQZrQ==
dependencies:
"@isaacs/balanced-match" "^4.0.1"

Expand Down Expand Up @@ -9744,7 +9744,16 @@ string-argv@~0.3.1:
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.2.tgz#2b6d0ef24b656274d957d54e0a4bbf6153dc02b6"
integrity sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -9776,7 +9785,14 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -10970,7 +10986,16 @@ word-wrap@^1.2.5:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down
Loading