Feat: Founding Partner login with autocreation of User, User Role Link, Company, User Company Link as necessary and autologin with new user - for approved Founding Partners only, otherwise redirected to login page.
This commit is contained in:
@@ -59,7 +59,7 @@ class DataStore_Base(BaseModel):
|
||||
@staticmethod
|
||||
def db_cursor_clear(cursor):
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'new result set: {cursor.fetchall()}')
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
@staticmethod
|
||||
def get_user_session():
|
||||
|
||||
@@ -85,7 +85,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return dogs, errors
|
||||
|
||||
@@ -138,7 +140,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return command_categories, commands, errors
|
||||
|
||||
@@ -161,7 +165,7 @@ class DataStore_Dog(DataStore_Base):
|
||||
|
||||
cls.upload_bulk(Command_Category_Temp.__tablename__, rows, 1000)
|
||||
|
||||
Helper_App.console_log('Commands uploaded')
|
||||
Helper_App.console_log('Command Categories uploaded')
|
||||
|
||||
argument_dict_list = {
|
||||
'a_comment': comment,
|
||||
@@ -171,7 +175,7 @@ class DataStore_Dog(DataStore_Base):
|
||||
}
|
||||
result = cls.db_procedure_execute('p_dog_save_command_category', argument_dict_list)
|
||||
|
||||
Helper_App.console_log('Commands saved')
|
||||
Helper_App.console_log('Command Categories saved')
|
||||
|
||||
# Errors
|
||||
cursor = result.cursor
|
||||
@@ -183,7 +187,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
@classmethod
|
||||
@@ -227,7 +233,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
|
||||
@@ -265,7 +273,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return dog_command_links, errors
|
||||
|
||||
@@ -310,7 +320,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
|
||||
@@ -347,7 +359,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return button_shapes, errors
|
||||
|
||||
@@ -385,7 +399,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return colours, errors
|
||||
|
||||
@@ -423,7 +439,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return locations, errors
|
||||
|
||||
@@ -471,7 +489,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return [] # errors
|
||||
|
||||
@@ -509,7 +529,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return button_icons, errors
|
||||
|
||||
@@ -557,7 +579,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return errors
|
||||
|
||||
@@ -596,7 +620,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return command_button_links, errors
|
||||
|
||||
@@ -641,7 +667,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
|
||||
@@ -678,7 +706,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return assessments, errors
|
||||
|
||||
@@ -726,7 +756,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return errors
|
||||
|
||||
@@ -764,7 +796,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return weathers, errors
|
||||
|
||||
@@ -802,7 +836,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return lighting_levels, errors
|
||||
|
||||
@@ -840,7 +876,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return distraction_types, errors
|
||||
|
||||
@@ -878,7 +916,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return distraction_intensity_levels, errors
|
||||
|
||||
@@ -917,7 +957,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return distractions, errors
|
||||
|
||||
@@ -965,7 +1007,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return errors
|
||||
|
||||
@@ -1003,7 +1047,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return command_modalities, errors
|
||||
|
||||
@@ -1041,7 +1087,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return bribes, errors
|
||||
|
||||
@@ -1079,7 +1127,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return assessment_command_modality_links, errors
|
||||
|
||||
@@ -1127,7 +1177,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return errors
|
||||
|
||||
@@ -1165,7 +1217,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return command_modalities, errors
|
||||
|
||||
@@ -1203,7 +1257,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return command_modalities, errors
|
||||
|
||||
@@ -1241,7 +1297,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return assessment_responses, errors
|
||||
|
||||
@@ -1289,7 +1347,9 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return errors
|
||||
|
||||
@@ -1362,6 +1422,8 @@ class DataStore_Dog(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return errors
|
||||
|
||||
@@ -61,11 +61,13 @@ class DataStore_Project_Hub_Contact_Form(DataStore_Base):
|
||||
Helper_App.console_log(f'raw errors: {result_set_e}')
|
||||
errors = []
|
||||
if len(result_set_e) > 0:
|
||||
errors = [SQL_Error.from_DB_record(row) for row in result_set_e]
|
||||
errors = [SQL_Error.from_db_record(row) for row in result_set_e]
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return contact_forms, errors
|
||||
|
||||
@@ -106,11 +108,13 @@ class DataStore_Project_Hub_Contact_Form(DataStore_Base):
|
||||
result_set_e = cursor.fetchall()
|
||||
errors = []
|
||||
if len(result_set_e) > 0:
|
||||
errors = [SQL_Error.from_DB_record(row) for row in result_set_e]
|
||||
errors = [SQL_Error.from_db_record(row) for row in result_set_e]
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
@classmethod
|
||||
@@ -150,9 +154,11 @@ class DataStore_Project_Hub_Contact_Form(DataStore_Base):
|
||||
result_set_e = cursor.fetchall()
|
||||
errors = []
|
||||
if len(result_set_e) > 0:
|
||||
errors = [SQL_Error.from_DB_record(row) for row in result_set_e]
|
||||
errors = [SQL_Error.from_db_record(row) for row in result_set_e]
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
@@ -14,7 +14,7 @@ Datastore for Users
|
||||
# from routes import bp_home
|
||||
import lib.argument_validation as av
|
||||
from business_objects.sql_error import SQL_Error
|
||||
from business_objects.dog.company import Company, Parameters_Company
|
||||
from business_objects.dog.company import Company, Parameters_Company, Company_Temp
|
||||
from business_objects.dog.role import Role, Parameters_Role
|
||||
from business_objects.dog.user import User, User_Temp, Parameters_User
|
||||
from datastores.datastore_base import DataStore_Base
|
||||
@@ -76,15 +76,24 @@ class DataStore_User(DataStore_Base):
|
||||
errors = []
|
||||
cursor.nextset()
|
||||
result_set_e = cursor.fetchall()
|
||||
Helper_App.console_log(f'raw errors: {result_set_e}')
|
||||
Helper_App.console_log(f'raw errors: {result_set_e}\nlength: {len(result_set_e)}')
|
||||
if len(result_set_e) > 0:
|
||||
errors = [SQL_Error.from_DB_record(row) for row in result_set_e]
|
||||
for row in result_set_e:
|
||||
Helper_App.console_log(f'row: {row}')
|
||||
error = SQL_Error.from_db_record(row)
|
||||
errors.append(error)
|
||||
error.__repr__()
|
||||
Helper_App.console_log(f'Error: {error}\nErrors: {errors}')
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
Helper_App.console_log(f"Error [{error.code_type}]: {error.msg}")
|
||||
# errors = None
|
||||
|
||||
DataStore_User.db_cursor_clear(cursor)
|
||||
|
||||
# cls.db_cursor_clear(cursor)
|
||||
try:
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
except Exception as e:
|
||||
Helper_App.console_log(f'Error: {str(e)}')
|
||||
return users, errors
|
||||
|
||||
@classmethod
|
||||
@@ -109,10 +118,10 @@ class DataStore_User(DataStore_Base):
|
||||
Helper_App.console_log('Users uploaded')
|
||||
|
||||
argument_dict_list = {
|
||||
'a_comment': comment,
|
||||
'a_guid': guid,
|
||||
'a_id_user': user.id_user,
|
||||
'a_debug': 0
|
||||
'a_comment': comment
|
||||
, 'a_guid': guid
|
||||
, 'a_id_user': user.id_user
|
||||
, 'a_debug': 0
|
||||
}
|
||||
result = cls.db_procedure_execute('p_dog_save_user', argument_dict_list)
|
||||
|
||||
@@ -128,25 +137,26 @@ class DataStore_User(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
@classmethod
|
||||
def save_new_founding_partner(cls, user):
|
||||
_m = f'{cls}.save_new_founding_partner'
|
||||
av.val_str(comment, 'comment', _m)
|
||||
# av.val_str(comment, 'comment', _m)
|
||||
|
||||
guid = Helper_DB_MySQL.create_guid_str()
|
||||
user = cls.get_user_session()
|
||||
|
||||
Helper_App.console_log(f'saving users: {users}')
|
||||
Helper_App.console_log(f'saving new founding partner: {user}')
|
||||
|
||||
argument_dict_list = {
|
||||
'a_comment': comment,
|
||||
'a_guid': guid,
|
||||
'a_id_user_auth0': user.id_user_auth0,
|
||||
'a_email_user': user.email
|
||||
'a_debug': 0
|
||||
'a_comment': 'save new founding partner'
|
||||
, 'a_guid': guid
|
||||
, 'a_id_user_auth0': user.id_user_auth0
|
||||
, 'a_email_user': user.email
|
||||
, 'a_debug': 0
|
||||
}
|
||||
result = cls.db_procedure_execute('p_dog_save_new_founding_partner', argument_dict_list)
|
||||
|
||||
@@ -156,13 +166,16 @@ class DataStore_User(DataStore_Base):
|
||||
cursor = result.cursor
|
||||
cursor.nextset()
|
||||
result_set_e = cursor.fetchall()
|
||||
Helper_App.console_log(f'raw errors: {result_set_e}')
|
||||
errors = []
|
||||
if len(result_set_e) > 0:
|
||||
errors = [SQL_Error.from_db_record(row) for row in result_set_e]
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
|
||||
|
||||
@@ -200,7 +213,9 @@ class DataStore_User(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return roles, errors
|
||||
|
||||
@@ -239,6 +254,54 @@ class DataStore_User(DataStore_Base):
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
cls.db_cursor_clear(cursor)
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
|
||||
return companies, errors
|
||||
return companies, errors
|
||||
|
||||
@classmethod
|
||||
def save_companies(cls, comment, companies):
|
||||
_m = f'{cls}.save_companies'
|
||||
av.val_str(comment, 'comment', _m)
|
||||
|
||||
guid = Helper_DB_MySQL.create_guid_str()
|
||||
now = datetime.now()
|
||||
user = cls.get_user_session()
|
||||
|
||||
Helper_App.console_log(f'saving command categories: {companies}')
|
||||
|
||||
rows = []
|
||||
for company in companies:
|
||||
row = Company_Temp.from_company(company)
|
||||
row.guid = guid
|
||||
rows.append(row)
|
||||
|
||||
cls.upload_bulk(Company_Temp.__tablename__, rows, 1000)
|
||||
|
||||
Helper_App.console_log('Commands uploaded')
|
||||
|
||||
argument_dict_list = {
|
||||
'a_comment': comment,
|
||||
'a_guid': guid,
|
||||
'a_id_user': user.id_user,
|
||||
'a_debug': 0
|
||||
}
|
||||
result = cls.db_procedure_execute('p_dog_save_company', argument_dict_list)
|
||||
|
||||
Helper_App.console_log('Companies saved')
|
||||
|
||||
# Errors
|
||||
cursor = result.cursor
|
||||
cursor.nextset()
|
||||
result_set_e = cursor.fetchall()
|
||||
errors = []
|
||||
if len(result_set_e) > 0:
|
||||
errors = [SQL_Error.from_db_record(row) for row in result_set_e]
|
||||
for error in errors:
|
||||
Helper_App.console_log(f"Error [{error.code}]: {error.msg}")
|
||||
|
||||
# cls.db_cursor_clear(cursor)
|
||||
while cursor.nextset():
|
||||
Helper_App.console_log(f'unexpected result set: {cursor.fetchall()}')
|
||||
return errors
|
||||
Reference in New Issue
Block a user