def create_blank(request):
    image_form = ImageBlankForm(request.POST)
    logger.debug(image_form)
    logger.debug(str(image_form))
    if image_form.is_valid():
        name = request.POST['name']
        size = request.POST['size']
        description = request.POST['description']
        file_path = ('user_images/' + name)
        if ('.img' not in file_path):
            file_path += '.img'
        full_path = ((settings.MEDIA_ROOT + '/') + file_path)
        if osUtils.create_blank_image(full_path, (size + 'G')):
            image = Image()
            image.description = description
            image.name = name
            image.filePath = file_path
            image.type = 'blank'
            image.save()
        logger.debug('Saving form')
        return HttpResponseRedirect('/images')
    else:
        context = {'image_form': image_form}
        return render(request, 'images/new_blank.html', context)
def create_blank(request):
    image_form = ImageBlankForm(request.POST)
    logger.debug(image_form)
    logger.debug(str(image_form))
    if image_form.is_valid():
        name = request.POST['name']
        size = request.POST['size']
        description = request.POST['description']
        file_path = ('user_images/' + name)
        if ('.img' not in file_path):
            file_path += '.img'
        full_path = ((settings.MEDIA_ROOT + '/') + file_path)
        if osUtils.create_blank_image(full_path, (size + 'G')):
            image = Image()
            image.description = description
            image.name = name
            image.filePath = file_path
            image.type = 'blank'
            image.save()
        logger.debug('Saving form')
        return HttpResponseRedirect('/images')
    else:
        context = {'image_form': image_form}
        return render(request, 'images/new_blank.html', context)