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

Feature/areg 126 #239

Merged
merged 14 commits into from
Apr 17, 2024
Merged

Feature/areg 126 #239

merged 14 commits into from
Apr 17, 2024

Conversation

D-GopalKrishna
Copy link
Contributor

Jira Link - https://metacell.atlassian.net/browse/AREG-126

Logic for set_vendor_from_name_url as following:

        If a new antibody is submitted with some vendor name and URL
        should be treated with following rules:
        - If both domain and vendor name are not recognized,
            a new vendor is created and the new domain is attached to the vendor.
        - If both domain and vendor name are recognized,
            the domain is prioritized. And vendor name is added as a synonym.
        - If the domain is not recognized but vendor name is recognized,
            the new domain is attached to the vendor recognized.
        - If domain is recognized and vendor name is not recognized,
            we add a vendor synonym

fixing the get after prefetch and select related. This failed the test before the fix.

antibody_mapper.to_dto(
            Antibody.objects.select_related("vendor", "source_organism")
            .prefetch_related("species")
            .prefetch_related("applications")
            .get(accession=accession)
        )

@filippomc - about the mapper's get_vendor_domains.
Reconsider using @cache - as this returns outdated results and breaks the test for vendors.

@filippomc filippomc self-requested a review April 17, 2024 08:42
@filippomc filippomc merged commit e5bf2ff into develop Apr 17, 2024
3 checks passed
self.curate_vendor_domains_for_antibody(ab.abId)
ab = get_antibody(ab.abId, status=STATUS.QUEUE)[0]

self.assertTrue("www.bdbiosciences.com" in ab.vendorUrl)

Check failure

Code scanning / CodeQL

Incomplete URL substring sanitization High test

The string
www.bdbiosciences.com
may be at an arbitrary position in the sanitized URL.
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.

2 participants