diff --git a/api/src/basic_types/__init__.py b/api/src/basic_types/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/api/src/membership/enums.py b/api/src/basic_types/enums.py similarity index 100% rename from api/src/membership/enums.py rename to api/src/basic_types/enums.py diff --git a/api/src/firstrun.py b/api/src/firstrun.py index 66b534678..4fa170c87 100755 --- a/api/src/firstrun.py +++ b/api/src/firstrun.py @@ -1,7 +1,7 @@ import argparse from sqlalchemy import func -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel from init_db import init_db from membership.models import Group, Permission, Member diff --git a/api/src/membership/models.py b/api/src/membership/models.py index f28347490..507d50c17 100644 --- a/api/src/membership/models.py +++ b/api/src/membership/models.py @@ -7,7 +7,7 @@ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, column_property, configure_mappers, validates -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel Base = declarative_base() diff --git a/api/src/shop/pay.py b/api/src/shop/pay.py index a87fc5079..58da0aeff 100644 --- a/api/src/shop/pay.py +++ b/api/src/shop/pay.py @@ -7,7 +7,7 @@ from dataclasses_json import DataClassJsonMixin import stripe -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel from shop.stripe_constants import MakerspaceMetadataKeys from shop.stripe_setup_intent import SetupIntentFailed, SetupIntentResult, handle_setup_intent from membership.models import Member, Span diff --git a/api/src/shop/stripe_discounts.py b/api/src/shop/stripe_discounts.py index 1b06eb9f7..c2c4d0ad2 100644 --- a/api/src/shop/stripe_discounts.py +++ b/api/src/shop/stripe_discounts.py @@ -5,7 +5,7 @@ from typing import TYPE_CHECKING, Dict, List, Optional import stripe from shop.stripe_util import retry -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel from shop.stripe_constants import MakerspaceMetadataKeys if TYPE_CHECKING: diff --git a/api/src/shop/stripe_subscriptions.py b/api/src/shop/stripe_subscriptions.py index 663e64bef..6caf1fe14 100644 --- a/api/src/shop/stripe_subscriptions.py +++ b/api/src/shop/stripe_subscriptions.py @@ -37,7 +37,7 @@ from datetime import datetime, timezone, date, time, timedelta from stripe.error import InvalidRequestError from shop.stripe_util import retry -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel from shop.stripe_discounts import get_discount_for_product, get_price_level_for_member from shop.models import Product, ProductAction, ProductCategory from service.error import BadRequest, NotFound diff --git a/api/src/shop/transactions.py b/api/src/shop/transactions.py index 5d935745b..12afaa469 100644 --- a/api/src/shop/transactions.py +++ b/api/src/shop/transactions.py @@ -8,7 +8,7 @@ from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound from sqlalchemy.sql import func -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel from messages.message import send_message from messages.models import MessageTemplate from shop.stripe_constants import MakerspaceMetadataKeys diff --git a/api/src/shop/views.py b/api/src/shop/views.py index 872ba23ae..ee95b8338 100644 --- a/api/src/shop/views.py +++ b/api/src/shop/views.py @@ -2,7 +2,7 @@ from typing import Any from flask import Response, g, request, send_file, make_response from sqlalchemy.exc import NoResultFound -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel from shop.stripe_discounts import get_discount_fraction_off from multiaccessy.invite import AccessyInvitePreconditionFailed, ensure_accessy_labaccess diff --git a/api/src/test_aid/obj.py b/api/src/test_aid/obj.py index dcd073c20..a262e3206 100644 --- a/api/src/test_aid/obj.py +++ b/api/src/test_aid/obj.py @@ -2,7 +2,7 @@ from random import randint, choice, seed from typing import Any, Dict from faker import Faker -from membership.enums import PriceLevel +from basic_types.enums import PriceLevel from membership.models import Member, Span from messages.models import Message diff --git a/create_user.py b/create_user.py index 93f4e35cc..136f10e1f 100755 --- a/create_user.py +++ b/create_user.py @@ -1,4 +1,6 @@ #!/usr/bin/env python3 +from api.src.basic_types.enums import PriceLevel + import argparse import sys import os @@ -36,6 +38,8 @@ def create_user(first_name: str, last_name: str, email: str, user_type: str, pas "email": email, "firstname": first_name, "lastname": last_name, + "pending_activation": False, + "price_level": PriceLevel.Normal.value, } if password is not None: payload["unhashed_password"] = password