Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 34-46 (lines=13) @@
31
            context = self.context
32
        return field.checkPermission("set", context)
33
34
    def get_field_by_name(self, name):
35
        """Get the field by name
36
        """
37
        field = self.fields.get(name)
38
39
        # try to fetch the field w/o the `get` prefix
40
        # this might be the case is some listings
41
        if field is None:
42
            # ensure we do not have the field setter as column
43
            name = name.split("get", 1)[-1]
44
            field = self.fields.get(name)
45
46
        return field
47
48
    def get(self, name):
49
        """Get sample field

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

@@ 34-46 (lines=13) @@
31
            context = self.context
32
        return field.checkPermission("set", context)
33
34
    def get_field_by_name(self, name):
35
        """Get the field by name
36
        """
37
        field = self.fields.get(name)
38
39
        # try to fetch the field w/o the `get` prefix
40
        # this might be the case is some listings
41
        if field is None:
42
            # ensure we do not have the field setter as column
43
            name = name.split("get", 1)[-1]
44
            field = self.fields.get(name)
45
46
        return field
47
48
    def get(self, name):
49
        """Get sample field