Fix software-compliance report + relationshiptypes zero-dates
- Add applications.isrequired (model + migration 7c02 + create/update + form checkbox). The software-compliance report compared required apps against installs but no such flag existed, so it 500'd; now it works. - Repair relationshiptypes rows with 0000-00-00 createddate/modifieddate (partof/connectedto) to real timestamps. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -65,6 +65,10 @@
|
|||||||
<input type="checkbox" v-model="form.isprinter" />
|
<input type="checkbox" v-model="form.isprinter" />
|
||||||
Printer App
|
Printer App
|
||||||
</label>
|
</label>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" v-model="form.isrequired" />
|
||||||
|
Required on all PCs
|
||||||
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" v-model="form.ishidden" />
|
<input type="checkbox" v-model="form.ishidden" />
|
||||||
Hidden
|
Hidden
|
||||||
@@ -168,6 +172,7 @@ const form = ref({
|
|||||||
isinstallable: false,
|
isinstallable: false,
|
||||||
islicenced: false,
|
islicenced: false,
|
||||||
isprinter: false,
|
isprinter: false,
|
||||||
|
isrequired: false,
|
||||||
ishidden: false,
|
ishidden: false,
|
||||||
applicationlink: '',
|
applicationlink: '',
|
||||||
documentationpath: '',
|
documentationpath: '',
|
||||||
@@ -196,6 +201,7 @@ onMounted(async () => {
|
|||||||
isinstallable: app.isinstallable || false,
|
isinstallable: app.isinstallable || false,
|
||||||
islicenced: app.islicenced || false,
|
islicenced: app.islicenced || false,
|
||||||
isprinter: app.isprinter || false,
|
isprinter: app.isprinter || false,
|
||||||
|
isrequired: app.isrequired || false,
|
||||||
ishidden: app.ishidden || false,
|
ishidden: app.ishidden || false,
|
||||||
applicationlink: app.applicationlink || '',
|
applicationlink: app.applicationlink || '',
|
||||||
documentationpath: app.documentationpath || '',
|
documentationpath: app.documentationpath || '',
|
||||||
@@ -224,6 +230,7 @@ async function saveApplication() {
|
|||||||
isinstallable: form.value.isinstallable,
|
isinstallable: form.value.isinstallable,
|
||||||
islicenced: form.value.islicenced,
|
islicenced: form.value.islicenced,
|
||||||
isprinter: form.value.isprinter,
|
isprinter: form.value.isprinter,
|
||||||
|
isrequired: form.value.isrequired,
|
||||||
ishidden: form.value.ishidden,
|
ishidden: form.value.ishidden,
|
||||||
applicationlink: form.value.applicationlink || null,
|
applicationlink: form.value.applicationlink || null,
|
||||||
documentationpath: form.value.documentationpath || null,
|
documentationpath: form.value.documentationpath || null,
|
||||||
|
|||||||
29
migrations/versions/7c02_application_isrequired.py
Normal file
29
migrations/versions/7c02_application_isrequired.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
"""Add applications.isrequired
|
||||||
|
|
||||||
|
Backs the software-compliance report, which compares required applications
|
||||||
|
against what is installed per PC. There was no such flag before, so the report
|
||||||
|
errored.
|
||||||
|
|
||||||
|
Revision ID: 7c02_app_isrequired
|
||||||
|
Revises: 7c01_drop_legacy_machine
|
||||||
|
Create Date: 2026-06-26
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
revision = '7c02_app_isrequired'
|
||||||
|
down_revision = '7c01_drop_legacy_machine'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.add_column('applications', sa.Column(
|
||||||
|
'isrequired', sa.Boolean(), nullable=True, server_default=sa.false(),
|
||||||
|
comment='Required on all PCs (drives the software-compliance report)'))
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
op.drop_column('applications', 'isrequired')
|
||||||
@@ -131,6 +131,7 @@ def create_application():
|
|||||||
ishidden=data.get('ishidden', False),
|
ishidden=data.get('ishidden', False),
|
||||||
isprinter=data.get('isprinter', False),
|
isprinter=data.get('isprinter', False),
|
||||||
islicenced=data.get('islicenced', False),
|
islicenced=data.get('islicenced', False),
|
||||||
|
isrequired=data.get('isrequired', False),
|
||||||
image=data.get('image')
|
image=data.get('image')
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -168,7 +169,7 @@ def update_application(app_id: int):
|
|||||||
fields = [
|
fields = [
|
||||||
'appname', 'appdescription', 'supportteamid', 'isinstallable',
|
'appname', 'appdescription', 'supportteamid', 'isinstallable',
|
||||||
'applicationnotes', 'installpath', 'applicationlink', 'documentationpath',
|
'applicationnotes', 'installpath', 'applicationlink', 'documentationpath',
|
||||||
'ishidden', 'isprinter', 'islicenced', 'image', 'isactive'
|
'ishidden', 'isprinter', 'islicenced', 'isrequired', 'image', 'isactive'
|
||||||
]
|
]
|
||||||
|
|
||||||
changes = {}
|
changes = {}
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ class Application(BaseModel):
|
|||||||
ishidden = db.Column(db.Boolean, default=False)
|
ishidden = db.Column(db.Boolean, default=False)
|
||||||
isprinter = db.Column(db.Boolean, default=False)
|
isprinter = db.Column(db.Boolean, default=False)
|
||||||
islicenced = db.Column(db.Boolean, default=False)
|
islicenced = db.Column(db.Boolean, default=False)
|
||||||
|
isrequired = db.Column(
|
||||||
|
db.Boolean, default=False,
|
||||||
|
comment='Required on all PCs (drives the software-compliance report)'
|
||||||
|
)
|
||||||
image = db.Column(db.String(255))
|
image = db.Column(db.String(255))
|
||||||
|
|
||||||
# Relationships
|
# Relationships
|
||||||
|
|||||||
Reference in New Issue
Block a user