def registry(self): """Return request registry.""" try: return webapp2.get_request().registry except AssertionError: return {}