bug: Allow empty end odometer for trips#186
Merged
Merged
Conversation
fix: calendar feed crash + fuel-to-fill consumption + station edit link (dannymcc#168, dannymcc#169, dannymcc#170)
dannymcc
added a commit
that referenced
this pull request
May 16, 2026
…rsion, export units - #182: nested <form> for attachment delete was closing the outer form on edit pages, orphaning the Save button. Replaced with a JS-driven POST helper that builds a hidden form on click — no nesting, full page reload preserves flash messages. - #183: <datalist> on quick fuel log shows a chevron in some browsers but doesn't always open. Switched to the same <select> + free-text pattern the full fuel form uses, which works consistently. - #181: consumption math used the raw odometer delta without converting to the unit each formula assumes (miles for MPG, km for L/100km). Added a shared _distance_in helper and applied it in FuelLog.get_consumption and Vehicle.get_average_consumption. Existing tests were encoding the broken behaviour, so sample_vehicle now pins odometer_unit='km' for clarity. - #173: Vehicle.get_total_distance ignored its distance_unit argument for non-Tessie vehicles, so the dashboard could label miles as km. Now uses _distance_in to convert from the vehicle's effective odometer unit. Added odometer_unit / distance_unit columns to the vehicles, fuel_logs, expenses and trips CSV exports so the data is self-describing. - Hardened get_last_odometer to skip trips with NULL end_odometer — follow-up to the #185 / PR #186 merge so max() doesn't crash on a freshly-created trip without an end odometer. - Bump APP_VERSION to 0.22.3
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs: #185
Summary
Allows "End Odometer" to be empty.
Testing
How were these changes tested?