|
@@ -2,8 +2,8 @@
|
|
|
# create default user in PoLZy DB
|
|
|
#
|
|
|
|
|
|
-from polzybackend.models import User, Role, Company, UserToCompany, CompanyToCompany, \
|
|
|
- GamificationEvent, GamificationBadgeLevel, GamificationBadgeType, GamificationBadge, GamificationBadgeDescription
|
|
|
+from polzybackend.models import User, Role, Company, UserToCompany, CompanyToCompany#, \
|
|
|
+# GamificationEvent, GamificationBadgeLevel, GamificationBadgeType, GamificationBadge, GamificationBadgeDescription
|
|
|
from random import sample, choice
|
|
|
from polzybackend.utils.auth_utils import generate_token
|
|
|
import uuid
|
|
@@ -17,7 +17,10 @@ app = create_app(Config)
|
|
|
db = SQLAlchemy(app)
|
|
|
print(db)
|
|
|
|
|
|
+
|
|
|
# Gamification Badges
|
|
|
+#### replaced by populate_gamification tables.py ####
|
|
|
+'''
|
|
|
print('Creating Gamification Badges...')
|
|
|
badge_levels = [
|
|
|
"Bronze",
|
|
@@ -48,6 +51,7 @@ db.session.add_all([
|
|
|
description=f"Requirements to earn {level.name} Badge {type.title}",
|
|
|
) for level in levels for type in types]
|
|
|
)
|
|
|
+'''
|
|
|
|
|
|
# create roles
|
|
|
print('Creating roles...')
|
|
@@ -137,6 +141,7 @@ db.session.add(organization_agent)
|
|
|
db.session.add(organization_clerk)
|
|
|
|
|
|
# add badges
|
|
|
+'''
|
|
|
user_badge_num = 10
|
|
|
db.session.add_all([
|
|
|
GamificationBadge(
|
|
@@ -146,6 +151,7 @@ db.session.add_all([
|
|
|
level=choice(levels),
|
|
|
) for _ in sample(range(total_badge_number), user_badge_num)
|
|
|
])
|
|
|
+'''
|
|
|
|
|
|
company = Company(
|
|
|
name="SportIns",
|