Nix-Security-WG / nix-security-tracker

Web service for managing information on vulnerabilities in software distributed through Nixpkgs
33 stars 7 forks source link

fix: m2m relationships on insertion #69

Closed alejandrosame closed 11 months ago

alejandrosame commented 11 months ago

On insertion, the function set_m2m was getting the relationiships for the same class collapsed into a None key. This caused m2m relationships to get lost during the processing.

With this fix, the logic can again retrieve the proper foreign keys from the self.m2m_models list.

For example, now each nixderivationmeta gets correctly linked to its corresponding nixderivationmeta_maintainers. This can be checked after ingestion by running the query SELECT * FROM shared_nixderivationmeta_maintainers;.