temp: add some logging around extended profile update functionality

I am trying to persist/save data through an "extended profile field" in Stage but the data isn't saving. I have this working locally with devstack but don't understand why it's not working in Stage.

This PR adds some logging so I can do some debugging in Stage and try and pinpoint if/where the issue is occurring.
This commit is contained in:
Justin Hynes
2023-02-01 12:57:33 -05:00
parent 15e7147613
commit c52ba9d26a
2 changed files with 13 additions and 0 deletions

View File

@@ -602,15 +602,18 @@ class UserProfile(models.Model):
return self.__enumerable_to_display(self.GENDER_CHOICES, self.gender)
def get_meta(self): # pylint: disable=missing-function-docstring
log.info(f"[Extended Profile] Retrieving user profile meta data for user {self.user.id}")
js_str = self.meta
if not js_str:
js_str = {}
else:
js_str = json.loads(self.meta)
log.info(f"[Extended Profile] Returning user profile meta data for user {self.user.id} with data [{js_str}]")
return js_str
def set_meta(self, meta_json):
log.info(f"[Extended Profile] Updating user profile meta data for user {self.user.id} with: [{meta_json}]")
self.meta = json.dumps(meta_json)
def set_login_session(self, session_id=None):