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

[fertiscan] As a dev, I want to prevent updates and deletions of completed inspections #252

Open
k-allagbe opened this issue Feb 17, 2025 · 1 comment · May be fixed by #235
Open

[fertiscan] As a dev, I want to prevent updates and deletions of completed inspections #252

k-allagbe opened this issue Feb 17, 2025 · 1 comment · May be fixed by #235

Comments

@k-allagbe
Copy link
Member

Description

A completed inspection should be immutable. Users should not be able to update or delete it. We want to make sure of this.

In the future, when access policies are implemented, this restriction might be overridden based on permissions.

Acceptance Criteria

  • A completed inspection cannot be updated.
  • A completed inspection cannot be deleted.
@Francois-Werbrouck
Copy link
Contributor

Francois-Werbrouck commented Feb 22, 2025

A completed inspection cannot be deleted.

Do you want to prevent ALL users from deleting it?

A completed inspection cannot be updated.

This is done

# A completed inspection cannot be updated
        if inspection.is_inspection_verified(
            cursor=cursor,
            inspection_id=updated_data.inspection_id
        ):
            raise inspection.InspectionUpdateError("The inspection you are trying to update is already verified")
        else:
            inspection.update_inspection(
                cursor=cursor,
                inspection_id=updated_data.inspection_id,
                verified=updated_data.verified,
                inspection_comment=updated_data.inspection_comment
            )
 # Rest of the Inspection update logi

@k-allagbe k-allagbe moved this to Paused in FertiScan Feb 24, 2025
Francois-Werbrouck added a commit that referenced this issue Feb 26, 2025
Francois-Werbrouck added a commit that referenced this issue Feb 27, 2025
Francois-Werbrouck added a commit that referenced this issue Feb 27, 2025
Francois-Werbrouck added a commit that referenced this issue Feb 27, 2025
…ed in inspection for consistency (#259)

* Issue #252: updated_at added to the Inspection model

* Issue #252: fix lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Paused
Development

Successfully merging a pull request may close this issue.

2 participants