-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix columns and filters - add formatters to remove milliseconds on dates - add column labels to be used with filters - add new filters for version and build views * fix screenshot management - remove edit function - fix file removal with row deletion * fix Babel initialisation * add service view and api check - add service view to admin interface - add service check on package upload * add and maintain md5 hashes - add a functions to get md5 hash in build model and spk - use function in build model when uploading build - use function in spk when signing/unsigning spk * remove builds from architecture create form * fix build environment and model - fix alembic setup environment - update model to match database - fix default sort for screenshot * Update nas test for major_version check * add major_version check - identify the major DSM version based on a closest match to the build - filter package versions based on match to major DSM version - include earlier "noarch" package version when major DSM version < 6 * fix download counter - rewrite catalog download links using md5 hashes for id - allow downloads of noarch builds to pass arch checks - rewrite nas tests for new url structure * Fix depopulate db function * Revert "fix download counter" This reverts commit bea7718. * Amend major_version check - Add type column to Firmware table - Increase length of version column - Filter by type for closest firmware when getting catalog - Update populate_db with firmware type * add validators for firmware input * fix Popped wrong app context. * fix 500 page on users: 'NoneType' object has no attribute 'strftime' BaseModelView.index_view() got an unexpected keyword argument 'cls' Flask-SQLAlchemy uses a custom formatter to handle date formatting when displaying data in the templates. It dosn't support overriding the value. * fix column formatting --------- Co-authored-by: publicarray <[email protected]>
- Loading branch information
1 parent
2db02f3
commit d8593ea
Showing
16 changed files
with
275 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = E203 | ||
per-file-ignores = __init__.py:F401 spkrepo/app.py:F841 | ||
per-file-ignores = __init__.py:F401 | ||
exclude = | ||
docs/* | ||
migrations/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[alembic] | ||
script_location = . | ||
script_location = ./migrations | ||
|
||
[loggers] | ||
keys = root,sqlalchemy,alembic | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
migrations/versions/f95855ce9471_add_firmware_type_and_increase_version_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"""Add firmware type and increase version length | ||
Revision ID: f95855ce9471 | ||
Revises: 76d559b4e873 | ||
Create Date: 2024-01-15 13:58:34.160242 | ||
""" | ||
revision = "f95855ce9471" | ||
down_revision = "76d559b4e873" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
|
||
def upgrade(): | ||
op.add_column("firmware", sa.Column("type", sa.Unicode(length=4))) | ||
# Set type based on version | ||
op.execute( | ||
""" | ||
UPDATE firmware | ||
SET type = CASE | ||
WHEN version LIKE '1.%' THEN 'srm' | ||
ELSE 'dsm' | ||
END | ||
""" | ||
) | ||
# Modify the column to be NOT NULL after setting the values | ||
op.alter_column("firmware", "type", nullable=False) | ||
|
||
op.alter_column( | ||
"firmware", | ||
"version", | ||
existing_type=sa.VARCHAR(length=3), | ||
type_=sa.Unicode(length=4), | ||
existing_nullable=False, | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.alter_column( | ||
"firmware", | ||
"version", | ||
existing_type=sa.Unicode(length=4), | ||
type_=sa.VARCHAR(length=3), | ||
existing_nullable=False, | ||
) | ||
op.drop_column("firmware", "type") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
IndexView, | ||
PackageView, | ||
ScreenshotView, | ||
ServiceView, | ||
UserView, | ||
VersionView, | ||
) | ||
|
Oops, something went wrong.