Skip to content

Question : models.Contribution.is_equal

https://gricad-gitlab.univ-grenoble-alpes.fr/mathdoc/ptfs/ptf-app-ptf/-/blob/master/src/ptf/models/classes/contribution.py?ref_type=heads#L88-102

    def is_equal(self, contribution):
        """
        return True if the contribution is identical, based on orcif/idref or homonimy
        TODO: override the __eq__ operator ? Not sure since homonimy is not bullet proof
        """
        equal = False
        if self.orcid and self.orcid == contribution.orcid:
            equal = True
        elif self.idref and self.idref == contribution.idref:
            equal = True
        else:
            equal = self.display_name() == contribution.display_name()

        return True
        return equal

This function returns always True.

It is only used once here : https://gricad-gitlab.univ-grenoble-alpes.fr/mathdoc/ptfs/ptf-app-ptf/-/blob/master/src/ptf/templatetags/helpers.py?ref_type=heads#L282

Blame shows the function was added in this commit : mathdoc/ptf@08619933

Edited by Nathan Tien You