def expected_notification_message(self, req, amounts): summary = sorted( ['%s:%d' % (str(Product.get(p).code), amt) for p, amt in amounts]) return const.notification_template( req.get_next_action().action).format( name='Unknown', # TODO currently not storing requester summary=' '.join(summary), loc=self.sp.location.site_code, keyword=req.get_next_action().keyword)
def expected_notification_message(self, req, amounts): summary = sorted( ['%s:%d' % (str(Product.get(p).code), amt) for p, amt in amounts] ) return const.notification_template(req.get_next_action().action).format( name='Unknown', # TODO currently not storing requester summary=' '.join(summary), loc=self.sp.location.site_code, keyword=req.get_next_action().keyword )
def get_notification_message(next_action, requisitions): # NOTE: it'd be weird if this was None but for now we won't fail hard guessed_location = requisitions[0].get_location() summary = ', '.join(r.sms_format() for r in requisitions) requester = requisitions[0].get_requester() return notification_template(next_action.action).format( name=requester.full_name if requester else "Unknown", summary=summary, loc=guessed_location.site_code if guessed_location else "<loc code>", keyword=next_action.keyword, )