From 22c9acf8e148e6079aba1080c94a4c5b2dde95ba Mon Sep 17 00:00:00 2001 From: Daniel Rahamim Date: Mon, 14 Oct 2024 15:47:44 -0700 Subject: [PATCH] feat(asset_return): show count of assets still out to staffer (#184) * feat(asset_return): show count of assets still out to staffer * style(parsecsv_staff): fix double space in code --- src/invenflask/app.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/invenflask/app.py b/src/invenflask/app.py index 4fb1428..312bb91 100644 --- a/src/invenflask/app.py +++ b/src/invenflask/app.py @@ -318,8 +318,9 @@ def return_asset(): flash('Asset was successfully returned!', "success") return redirect(url_for('return_asset')) else: + assets_still_out = len(current_checkouts) flash('Asset was successfully returned!', "success") - flash('Staffer still has assets checked out', "warning") + flash(f'Staffer still has {assets_still_out} assets checked out', "warning") return redirect(url_for('return_asset')) except Exception as e: app.logger.error(e) @@ -408,7 +409,7 @@ def parseCSV_staff(filePath, first_name=False, last_name_col=False, staff_id=Fal csvData = pd.read_csv(filePath, header=0, keep_default_na=False) for i, row in csvData.iterrows(): try: - last_name = row[last_name_col] if last_name_col else "" + last_name = row[last_name_col] if last_name_col else "" division = row[division_col] if division_col else "" title = row[title_col] if title_col else ""