Skip to content

Commit 057a032

Browse files
committed
undo function
1 parent f00c127 commit 057a032

File tree

5 files changed

+6
-43
lines changed

5 files changed

+6
-43
lines changed

services/web/server/src/simcore_service_webserver/groups/_classifiers_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ..scicrunch.service_client import SciCrunch
1515
from ..security.decorators import permission_required
1616
from ..utils_aiohttp import envelope_json_response
17-
from ._classifiers_api import GroupClassifierRepository, build_rrids_tree_view
17+
from ._classifiers_service import GroupClassifierRepository, build_rrids_tree_view
1818
from ._common.exceptions_handlers import handle_plugin_requests_exceptions
1919
from ._common.schemas import GroupsClassifiersQuery, GroupsPathParams
2020

services/web/server/src/simcore_service_webserver/groups/_groups_repository.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import re
22
from copy import deepcopy
3-
from datetime import datetime
43

54
import sqlalchemy as sa
65
from aiohttp import web
76
from common_library.groups_enums import GroupType
8-
from common_library.users_enums import UserRole, UserStatus
97
from models_library.basic_types import IDStr
108
from models_library.groups import (
119
AccessRightsDict,
@@ -17,7 +15,6 @@
1715
StandardGroupCreate,
1816
StandardGroupUpdate,
1917
)
20-
from models_library.products import ProductName
2118
from models_library.users import UserID
2219
from simcore_postgres_database.errors import UniqueViolation
2320
from simcore_postgres_database.models.users import users
@@ -751,34 +748,3 @@ async def auto_add_user_to_product_group(
751748
.on_conflict_do_nothing() # in case the user was already added to this group
752749
)
753750
return product_group_id
754-
755-
756-
async def auto_create_guest_user_and_add_to_product_group(
757-
app: web.Application,
758-
connection: AsyncConnection | None = None,
759-
*,
760-
random_user_name: str,
761-
email: str,
762-
password_hash: str,
763-
expires_at: datetime,
764-
product_name: ProductName,
765-
):
766-
async with transaction_context(get_asyncpg_engine(app), connection) as conn:
767-
query = (
768-
users.insert()
769-
.values(
770-
name=random_user_name,
771-
email=email,
772-
password_hash=password_hash,
773-
status=UserStatus.ACTIVE,
774-
role=UserRole.GUEST,
775-
expires_at=expires_at,
776-
)
777-
.returning(users.c.id)
778-
)
779-
780-
user_id = await conn.scalar(query)
781-
782-
await auto_add_user_to_product_group(
783-
app, connection, user_id=user_id, product_name=product_name
784-
)

services/web/server/src/simcore_service_webserver/groups/_groups_service.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,6 @@ async def auto_add_user_to_product_group(
233233
)
234234

235235

236-
auto_create_guest_user_and_add_to_product_group = (
237-
_groups_repository.auto_create_guest_user_and_add_to_product_group
238-
)
239-
240-
241236
def _only_one_true(*args):
242237
return sum(bool(arg) for arg in args) == 1
243238

services/web/server/src/simcore_service_webserver/groups/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from .._constants import APP_SETTINGS_KEY
77
from ..products.plugin import setup_products
8-
from . import _classifiers_handlers, _groups_rest
8+
from . import _classifiers_rest, _groups_rest
99

1010
_logger = logging.getLogger(__name__)
1111

@@ -24,4 +24,4 @@ def setup_groups(app: web.Application):
2424
setup_products(app)
2525

2626
app.router.add_routes(_groups_rest.routes)
27-
app.router.add_routes(_classifiers_handlers.routes)
27+
app.router.add_routes(_classifiers_rest.routes)

services/web/server/tests/unit/with_dbs/01/test_groups_classifiers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
import sqlalchemy as sa
99
from servicelib.common_aiopg_utils import DataSourceName, create_pg_engine
1010
from simcore_service_webserver._constants import APP_AIOPG_ENGINE_KEY
11-
from simcore_service_webserver.groups._classifiers_api import GroupClassifierRepository
11+
from simcore_service_webserver.groups._classifiers_service import (
12+
GroupClassifierRepository,
13+
)
1214
from sqlalchemy.sql import text
1315

1416

0 commit comments

Comments
 (0)