fix issue with no scan
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-04 22:31:49 +01:00
parent e3cd57d1e6
commit e00d5eb025
2 changed files with 3 additions and 1 deletions

View File

@@ -7,6 +7,6 @@ COPY --chown=reflex --from=gitea.pb42.de/matthias/reflex-ipad:builder /app /app
COPY --chown=reflex deploy/* .
RUN chown reflex:reflex /app
USER reflex
ENV PATH="/app/.venv/bin:$PATH" API_URL=$API_URL
ENV PATH="/app/.venv/bin:$PATH" API_URL=$API_URL PYTHONUNBUFFERED=TRUE
CMD reflex db migrate && reflex run --env dev --backend-only

View File

@@ -36,6 +36,8 @@ class NewMedicineState(rx.State):
statement = select(Scan).order_by(Scan.timestamp.desc()).limit(1)
results = session.exec(statement)
self.last_scan = results.first()
if self.last_scan is None:
return
if self.last_scan.timestamp > self.lastupdatetime:
self.last_scan_uuid = self.last_scan.uuid
if not self.show_med_add_form: