Fixing OPML upload

This commit is contained in:
Samuel Clay 2021-04-29 13:25:28 -04:00
parent b9f18ad3af
commit 7af0e27bde
2 changed files with 3 additions and 3 deletions

View file

@ -30,9 +30,9 @@ debug:
- newsblur := $(shell docker ps -qf "name=newsblur_web")
- CURRENT_UID=${CURRENT_UID} CURRENT_GID=${CURRENT_GID} docker attach ${newsblur}
log:
- docker-compose logs -f newsblur_web newsblur_node
- docker-compose logs -f --tail 20 newsblur_web newsblur_node
logs:
- docker-compose logs -f
- docker-compose logs -f --tail 20
# brings down containers
down:
- docker-compose -f docker-compose.yml down

View file

@ -33,7 +33,7 @@ def opml_upload(request):
if 'file' in request.FILES:
logging.user(request, "~FR~SBOPML upload starting...")
file = request.FILES['file']
xml_opml = str(file.read().decode('utf-8', 'ignore'))
xml_opml = file.read()
try:
UploadedOPML.objects.create(user_id=request.user.pk, opml_file=xml_opml)
except (UnicodeDecodeError, InvalidStringData):