Refactor application configuration; implement dynamic database URI setup based on environment variables for improved flexibility and maintainability
This commit is contained in:
parent
86a4e4d22f
commit
e67ae63eb8
10 changed files with 88 additions and 29 deletions
|
@ -165,7 +165,12 @@ def index():
|
|||
'Deployed','Inoperable', 'Partially Inoperable',
|
||||
'Unverified', 'Working'
|
||||
]
|
||||
pivot = df['condition'].value_counts().reindex(expected_conditions, fill_value=0)
|
||||
print(df)
|
||||
if 'condition' in df.columns:
|
||||
pivot = df['condition'].value_counts().reindex(expected_conditions, fill_value=0)
|
||||
else:
|
||||
pivot = pd.Series([0] * len(expected_conditions), index=expected_conditions)
|
||||
|
||||
|
||||
# Convert pandas/numpy int64s to plain old Python ints
|
||||
pivot = pivot.astype(int)
|
||||
|
@ -376,7 +381,7 @@ def search():
|
|||
query = request.args.get('q', '').strip()
|
||||
|
||||
if not query:
|
||||
return redirect(url_for('index'))
|
||||
return redirect(url_for('main.index'))
|
||||
|
||||
InventoryAlias = aliased(Inventory)
|
||||
UserAlias = aliased(User)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue