def require_completion(f):
 @functools.wraps(f)
 def wrapper(*args, **kwargs):
  if store.exists(store.image_mark_path(kwargs['image_id'])):
   return toolkit.api_error('Image is being uploaded, retry later')
  return f(*args, **kwargs)
 return wrapper

def require_completion ( f ) : @ functools . wraps ( f ) def wrapper ( * args , ** kwargs ) : if store . exists ( store . image_mark_path ( kwargs [ 'image_id' ] ) ) : return toolkit . api_error ( 'Image is being uploaded, retry later' ) return f ( * args , ** kwargs ) return wrapper
this make sure that the image push correctly finished .