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

Added BBB getters for PR #2213 #2216

Merged
merged 2 commits into from
Dec 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 29 additions & 4 deletions src/bika/lims/content/analysisrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1482,12 +1482,37 @@ def getClient(self):
return self.aq_parent.getClient()
return None

def getProfilesTitleStr(self):
@deprecated("Will be removed in SENAITE 3.0")
def getProfilesURL(self):
"""Returns a list of all profile URLs

Backwards compatibility for removed computed field:
https://github.com/senaite/senaite.core/pull/2213
"""
return [profile.absolute_url_path() for profile in self.getProfiles()]

@deprecated("Please use getRawProfiles instead. Will be removed in SENAITE 3.0")
def getProfilesUID(self):
"""Returns a list of all profile UIDs

Backwards compatibility for removed computed field:
https://github.com/senaite/senaite.core/pull/2213
"""
return self.getRawProfiles()

def getProfilesTitle(self):
"""Returns a list of all profile titles

Backwards compatibility for removed computed field:
https://github.com/senaite/senaite.core/pull/2213
"""
return [profile.Title() for profile in self.getProfiles()]

def getProfilesTitleStr(self, separator=", "):
"""Returns a comma-separated string withg the titles of the profiles
assigned to this Sample. Used to populate a metadata field
"""
profiles = [profile.Title() for profile in self.getProfiles()]
return ", ".join(profiles)
return separator.join(self.getProfilesTitle())

def getAnalysisService(self):
proxies = self.getAnalyses(full_objects=False)
Expand Down Expand Up @@ -1771,7 +1796,7 @@ def printInvoice(self, REQUEST=None, RESPONSE=None):
invoice_url = invoice.absolute_url()
RESPONSE.redirect('{}/invoice_print'.format(invoice_url))

@deprecated("Use getVerifiers instead")
@deprecated("Use getVerifiers instead. Will be removed in SENAITE 3.0")
@security.public
def getVerifier(self):
"""Returns the user that verified the whole Analysis Request. Since the
Expand Down