openwisp / django-x509

Reusable django app implementing x509 PKI certificates management
http://openwisp.org
BSD 3-Clause "New" or "Revised" License
340 stars 69 forks source link

[bug] CA/Cert creation generates 2 SQL write queries instead of 1 #120

Open nemesifier opened 3 years ago

nemesifier commented 3 years ago

This code:

https://github.com/openwisp/django-x509/blob/c5a5acda6ae7a247bb9bb965a2ea83fc9da0f46a/django_x509/base/models.py#L206-L217

Generates two queries for creating a certificate and a CA.

I figured this out while working on https://github.com/openwisp/openwisp-controller/pull/455.

I think this part could be optimized.