Skip to content

Commit

Permalink
Merge pull request #327 from makerspace/db/create-user-fix
Browse files Browse the repository at this point in the history
Fix missing inputs to create_user script
  • Loading branch information
BerglundDaniel authored Oct 31, 2023
2 parents 543d9d6 + 62e69c4 commit 5401828
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 8 deletions.
Empty file added api/src/basic_types/__init__.py
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion api/src/firstrun.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/src/membership/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion api/src/shop/pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/src/shop/stripe_discounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion api/src/shop/stripe_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/src/shop/transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/src/shop/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion api/src/test_aid/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions create_user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env python3
from api.src.basic_types.enums import PriceLevel

import argparse
import sys
import os
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5401828

Please sign in to comment.