def get_review_request(self):
        if hasattr(self, '_review_request'):
            return self._review_request

        try:
            return self.review_request.all()[0]
        except IndexError:
            try:
                return self.inactive_review_request.all()[0]
            except IndexError:
                # Maybe it's on a draft.
                try:
                    draft = self.drafts.get()
                except ObjectDoesNotExist:
                    draft = self.inactive_drafts.get()

                return draft.review_request
Return the ReviewRequest that this file is attached to.
dataset/ETHPy150Open reviewboard/reviewboard/reviewboard/attachments/models.py/FileAttachment.get_review_request