Skip to content
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 MissingCardPage not showing when no card is detected #507

Merged
merged 1 commit into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions backend/src/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ async def imageupload(
if label in TYPOLOGIES_MEASURED:
gun_length, gun_barrel_length, conf_card = get_lengths(img_bytes)

# Temporary fix while ML package send 0 instead of None
# https://github.com/dnum-mi/basegun-ml/issues/14
gun_length = None if gun_length == 0 else gun_length
gun_barrel_length = None if gun_barrel_length == 0 else gun_barrel_length

extras_logging["bg_label"] = label
extras_logging["bg_confidence"] = confidence
extras_logging["bg_gun_length"] = gun_length
Expand Down
2 changes: 2 additions & 0 deletions frontend/cypress/e2e/firearm-fiability.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ describe("Firearm Fiability", () => {
cy.wait("@upload").then(({ response }) => {
expect(response.statusCode).to.eq(200);
});
cy.url().should("contain", "/carte-manquante");
cy.contains("Je souhaite tout de même poursuivre").click();
cy.url().should("contain", "/guide-identification/resultat-typologie");
cy.contains("h2", "Typologie non déterminée");
});
Expand Down
2 changes: 2 additions & 0 deletions frontend/cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ Cypress.Commands.add("arrierePlatRevolver", () => {
Cypress.Commands.add("IdentificationShoulderBoltRifle", () => {
cy.url().should("contain", "/fin-mise-en-securite");
cy.getByDataTestid("go-to-identification").click();
cy.url().should("contain", "/carte-manquante");
cy.contains("Je souhaite tout de même poursuivre").click();
cy.url().should("contain", "/resultat-typologie");
cy.getByDataTestid("next-step").click();
cy.url().should(
Expand Down
Loading
Loading