-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix temperature breach filter #2589
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,9 @@ impl<'a> TemperatureLogRepository<'a> { | |
query = query.order(temperature_log_dsl::datetime.desc()) | ||
} | ||
|
||
// Debug diesel query | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just to help with debugging π€· |
||
// println!("{}", diesel::debug_query::<DBType, _>(&query).to_string()); | ||
|
||
let result = query | ||
.offset(pagination.offset as i64) | ||
.limit(pagination.limit as i64) | ||
|
@@ -128,7 +131,6 @@ impl<'a> TemperatureLogRepository<'a> { | |
.select(location_dsl::id.nullable()); | ||
query = query.filter(temperature_log_dsl::location_id.eq_any(location_ids)); | ||
} | ||
|
||
if temperature_breach.is_some() { | ||
let temperature_breach_ids = | ||
TemperatureBreachRepository::create_filtered_query(temperature_breach) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,7 +109,7 @@ fn validate_sensor(sensor: &Sensor) -> Result<(), String> { | |
} | ||
match sensor.log_delay { | ||
Some(log_delay) => { | ||
if log_delay < 1 { | ||
if log_delay < 0 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the 'add a debug sensor' function creates a record with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think technically positive number are greater then zero. Ohh, what is the add a debug sensor function btw ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the cold chain app - under developer settings you can add a sensor, and then add random logs for it. |
||
return Err(format!(" {}: Log delay must be positive", sensor.id)); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Offroad: the legend was showing with names centred: