Work on user password updates
This commit is contained in:
@@ -737,7 +737,7 @@ def create_update_aether_person(
|
|||||||
person_data['external_id'] = person_external_id
|
person_data['external_id'] = person_external_id
|
||||||
log.debug(person_data)
|
log.debug(person_data)
|
||||||
|
|
||||||
if update_person_kiss(person_id=person_id, person_dict_obj=person_data):
|
if update_person_kiss(person_id=person_id, person_dict_obj=person_data, set_default_password=False):
|
||||||
log.info(f'Updated Person ID: {person_id}')
|
log.info(f'Updated Person ID: {person_id}')
|
||||||
else:
|
else:
|
||||||
log.info(f'Did not update Person ID: {person_id}')
|
log.info(f'Did not update Person ID: {person_id}')
|
||||||
|
|||||||
@@ -148,6 +148,7 @@ def update_person_kiss(
|
|||||||
contact_id: int|None = None,
|
contact_id: int|None = None,
|
||||||
organization_id: int|None = None,
|
organization_id: int|None = None,
|
||||||
user_id: int|None = None,
|
user_id: int|None = None,
|
||||||
|
set_default_password: bool = True,
|
||||||
log_lvl: int = logging.DEBUG, # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log_lvl: int = logging.DEBUG, # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
) -> bool:
|
) -> bool:
|
||||||
log.setLevel(log_lvl)
|
log.setLevel(log_lvl)
|
||||||
@@ -235,6 +236,7 @@ def update_person_kiss(
|
|||||||
user_id = user_id,
|
user_id = user_id,
|
||||||
user_dict_obj = person_obj.user,
|
user_dict_obj = person_obj.user,
|
||||||
person_id = person_id,
|
person_id = person_id,
|
||||||
|
set_default_password = False,
|
||||||
): pass # NOTE: There is a trigger that will update the person record with the new user ID.
|
): pass # NOTE: There is a trigger that will update the person record with the new user ID.
|
||||||
else: return False
|
else: return False
|
||||||
elif person_obj.user:
|
elif person_obj.user:
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ def create_user_obj(
|
|||||||
else:
|
else:
|
||||||
log.warning('A new password was not passed and not setting a default password.')
|
log.warning('A new password was not passed and not setting a default password.')
|
||||||
|
|
||||||
|
|
||||||
log.debug(user_obj.new_password)
|
log.debug(user_obj.new_password)
|
||||||
|
|
||||||
# user_dict['password'] = user_obj.password # There has to be a better way to do this??? It thinks "password" is unset and so is excluded?
|
# user_dict['password'] = user_obj.password # There has to be a better way to do this??? It thinks "password" is unset and so is excluded?
|
||||||
|
|||||||
Reference in New Issue
Block a user