Skip to content
Snippets Groups Projects
Verified Commit 81c60487 authored by Stefan Hynek's avatar Stefan Hynek :drooling_face:
Browse files

fix(textgrid_dav_provider): use tgclients for `TextgridAuth`

parent 49f8b4f6
No related branches found
No related tags found
1 merge request!8Resolve "integrate with tgclients lib"
......@@ -5,6 +5,7 @@ import logging
import threading
from pprint import pformat
from tgclients.auth import TextgridAuth
from tgclients.config import TextgridConfig
from tgclients.crud import TextgridCRUD
from wsgidav.dav_provider import DAVCollection, DAVNonCollection, DAVProvider
......@@ -12,7 +13,7 @@ from wsgidav.util import join_uri, pop_path
from repdav.stream_tools import FileLikeQueue
from .tgapi import TextgridAuth, TextgridSearch
from .tgapi import TextgridSearch
_logger = logging.getLogger(__name__)
......@@ -32,7 +33,9 @@ class TextgridRoot(DAVCollection):
def get_member_names(self):
_logger.debug("Called TextgridRoot.get_member_names(self).")
projects = tuple(TextgridAuth().assigned_projects(self._sid))
config = TextgridConfig()
auth = TextgridAuth(config)
projects = tuple(auth.list_assigned_projects(self._sid))
_logger.debug("MY PROJECTS: %s", projects)
return projects
......@@ -152,7 +155,9 @@ class TextgridProject(DAVCollection):
class TextgridAggregation(DAVCollection):
def __init__(self, path, environ, info):
_logger.debug("Called TextgridAggregation.__init__(self, %s, environ, info).", path)
_logger.debug(
"Called TextgridAggregation.__init__(self, %s, environ, info).", path
)
DAVCollection.__init__(self, path, environ)
self._sid = environ["wsgidav.auth.user_name"]
self._info = info
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment