hooram / ownphotos

Self hosted alternative to Google Photos
MIT License
2.77k stars 233 forks source link

Handle nextcloud field is empty and fix #41 removing frontend from container #46

Closed guysoft closed 5 years ago

guysoft commented 5 years ago

Fixes this error, which happends if nextcloud field is empty:

ownphotos-backend  | Internal Server Error: /api/nextcloud/listdir/
ownphotos-backend  | Traceback (most recent call last):
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/django/core/handlers/exception.py", line 34, in inner
ownphotos-backend  |     response = get_response(request)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response
ownphotos-backend  |     response = self.process_exception_by_middleware(e, request)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 124, in _get_response
ownphotos-backend  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
ownphotos-backend  |     return view_func(*args, **kwargs)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/django/views/generic/base.py", line 68, in view
ownphotos-backend  |     return self.dispatch(request, *args, **kwargs)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/rest_framework/views.py", line 483, in dispatch
ownphotos-backend  |     response = self.handle_exception(exc)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/rest_framework/views.py", line 443, in handle_exception
ownphotos-backend  |     self.raise_uncaught_exception(exc)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/rest_framework/views.py", line 480, in dispatch
ownphotos-backend  |     response = handler(request, *args, **kwargs)
ownphotos-backend  |   File "/code/nextcloud/views.py", line 17, in get
ownphotos-backend  |     nc = nextcloud.Client(request.user.nextcloud_server_address)
ownphotos-backend  |   File "/venv/lib/python3.5/site-packages/owncloud/owncloud.py", line 327, in __init__
ownphotos-backend  |     if not url.endswith('/'):
guysoft commented 5 years ago

This PR also holds a fix now to #41