Encapsulate debugging logging in __debug__ contexts.
@@ -506,12 +506,14 @@ def file_download_url_mapper(request, shortkey):
return HTTPResponse("access not authorized", status=status.HTTP_401_UNAUTHORIZED)
istorage = res.get_irods_storage()
+ if __debug__:
logger.debug("request path is {}".format(request.path))
path_split = request.path.split('/')[2:] # strip /resource/
public_file_path = '/'.join(path_split)
# logger.debug("public_file_path is {}".format(public_file_path))
istorage = res.get_irods_storage()
file_download_url = istorage.url(public_file_path)
+ if __debug__:
logger.debug("redirect is {}".format(file_download_url))
return HttpResponseRedirect(file_download_url)
@@ -544,9 +546,9 @@ def delete_multiple_files(request, shortkey, *args, **kwargs):
except ObjectDoesNotExist as ex:
# Since some specific resource types such as feature resource type delete all other
# dependent content files together when one file is deleted, we make this specific
- # ObjectDoesNotExist exception as legitimate in deplete_multiple_files() without
+ # ObjectDoesNotExist exception as legitimate in delete_multiple_files() without
# raising this specific exception
- logger.debug(ex.message)
+ logger.warn(ex.message)
continue
request.session['resource-mode'] = 'edit'
return HttpResponseRedirect(request.META['HTTP_REFERER'])
