def get(self): args = self.req_parser.parse_args() event_id = args['event_id'] review_form = review_repository.get_review_form(event_id) if review_form is None: return EVENT_NOT_FOUND reviews_remaining_count = review_repository.get_remaining_reviews_count( g.current_user['id'], review_form.application_form_id) skip = self.sanitise_skip(args['skip'], reviews_remaining_count) response = review_repository.get_response_to_review( skip, g.current_user['id'], review_form.application_form_id) return ReviewResponseUser(review_form, response, reviews_remaining_count)
def get(self): args = self.req_parser.parse_args() event_id = args['event_id'] review_form = review_repository.get_review_form(event_id) if review_form is None: return EVENT_NOT_FOUND reviews_remaining_count = review_repository.get_remaining_reviews_count( g.current_user['id'], review_form.application_form_id) skip = self.sanitise_skip(args['skip'], reviews_remaining_count) response = review_repository.get_response_to_review( skip, g.current_user['id'], review_form.application_form_id) references = [] if response is not None: reference_requests = reference_repository.get_all_by_response_id( response.id) for r in reference_requests: reference = reference_repository.get_reference_by_reference_request_id( r.id) if reference is not None: references.append( ReviewResponseReference(r.title, r.firstname, r.lastname, r.relation, reference.uploaded_document)) review_response = None if response is None else review_repository.get_review_response( review_form.id, response.id, g.current_user['id']) references = None if len(references) == 0 else references return ReviewResponseUser(review_form, response, reviews_remaining_count, args['language'], reference_responses=references, review_response=review_response)