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/redundant sql query during ca cert creation #170

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SitaGanesh
Copy link

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #168 .

Description of Changes

[base/models] Avoid redundant SQL write query during CA/Cert creation

Refactored the save() method to simplify logic and avoid unnecessary SQL write queries during CA/Certificate creation. Additionally, the test case in django_x509/tests/test_cert.py was updated to utilize assertNumQueries, ensuring a reduction in database queries is verified automatically.

Fixes #168.

Screenshot

Please include any relevant screenshots.
test-cases-for-save-method-no-errors-regarding
assertNumQueries-test-case-solved

@SitaGanesh SitaGanesh force-pushed the fix/redundant-sql-query-during-ca-cert-creation branch from 00723a0 to 11e8c8f Compare January 1, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant