Code Duplication    Length = 13-13 lines in 2 locations

src/senaite/core/datamanagers/content/sample.py 1 location

@@ 52-64 (lines=13) @@
49
            context = self.context
50
        return field.checkPermission("set", context)
51
52
    def get_field_by_name(self, name):
53
        """Get the field by name
54
        """
55
        field = self.fields.get(name)
56
57
        # try to fetch the field w/o the `get` prefix
58
        # this might be the case is some listings
59
        if field is None:
60
            # ensure we do not have the field setter as column
61
            name = name.split("get", 1)[-1]
62
            field = self.fields.get(name)
63
64
        return field
65
66
    def get(self, name):
67
        """Get sample field

src/senaite/core/datamanagers/content/analysisservice.py 1 location

@@ 51-63 (lines=13) @@
48
            context = self.context
49
        return field.checkPermission("set", context)
50
51
    def get_field_by_name(self, name):
52
        """Get the field by name
53
        """
54
        field = self.fields.get(name)
55
56
        # try to fetch the field w/o the `get` prefix
57
        # this might be the case is some listings
58
        if field is None:
59
            # ensure we do not have the field setter as column
60
            name = name.split("get", 1)[-1]
61
            field = self.fields.get(name)
62
63
        return field
64
65
    def get(self, name):
66
        """Get sample field