Ejemplo n.º 1
0
    def get(self):
        """Get all photos as list"""
        try:
            photos = [
                photo_deserialize(photo)
                for photo in Photo.query(get_jwt_identity()['user_id'])
            ]
            app.logger.debug('success:photos_list: {}'.format(photos))
            return make_response({'ok': True, 'photos': photos}, 200)

        except Exception as e:
            app.logger.error('Photos list retrieving failed')
            app.logger.error(e)
            raise InternalServerError('Photos list retrieving failed')
    def get(self):
        """Get all photos as list"""
        token = get_token_from_header(request)
        try:
            user = get_cognito_user(token)
            photos = Photo.query(user['user_id'])
            data = {'photos': []}
            [data['photos'].append(with_presigned_url(user, photo)) for photo in photos]
            app.logger.debug('success:photos_list: {}'.format(data))
            return make_response({'ok': True, 'photos': data['photos']}, 200)

        except Exception as e:
            app.logger.error('ERROR:photos list failed')
            app.logger.error(e)
            raise InternalServerError('Photos list retrieving failed')
Ejemplo n.º 3
0
    def get(self):
        """Get all photos as list"""

        data = {'photos': []}
        try:
            photos = Photo.query(get_jwt_identity()['user_id'])
            for photo in photos:
                data['photos'].append(photo_deserialize(photo))

            app.logger.debug("success:photos_list:{}".format(data))
            return m_response(data['photos'], 200)
        except Exception as e:
            app.logger.error("ERROR:photos list failed")
            app.logger.error(e)
            return err_response(e, 500)
Ejemplo n.º 4
0
    def get(self):
        """Get all photos as list"""
        token = get_token_from_header(request)
        try:
            user = get_cognito_user(token)
            photos = Photo.query(user['user_id'])

            data = {'photos': []}
            [data['photos'].append(with_presigned_url(user, photo)) for photo in photos]

            app.logger.debug("success:photos_list:{}".format(data))

            return m_response(data['photos'], 200)
        except Exception as e:
            app.logger.error("ERROR:photos list failed")
            app.logger.error(e)
            return err_response(e, 500)
Ejemplo n.º 5
0
    def get(self):
        """Get all photos as list"""

        try:
            user = get_jwt_identity()
            photos = Photo.query(get_jwt_identity()['user_id'])
            data = {'photos': []}
            [
                data['photos'].append(with_presigned_url(user, photo))
                for photo in photos
            ]
            app.logger.debug("success:photos_list:{}".format(data))
            return make_response({'ok': True, 'photos': data['photos']}, 200)

        except Exception as e:
            app.logger.error('Photos list retrieving failed')
            app.logger.error(e)
            raise InternalServerError('Photos list retrieving failed')