Commit 12f3c731 authored by 段英荣's avatar 段英荣

modify

parent c6999aba
...@@ -37,11 +37,13 @@ class User(models.Model): ...@@ -37,11 +37,13 @@ class User(models.Model):
@classmethod @classmethod
def get_user_nick_name(cls,user_id): def get_user_nick_name(cls,user_id):
try: try:
nick_name_obj = User.objects.using(settings.SLAVE_DB_NAME).filter(user_id=user_id).values_list("nick_name") nick_name_obj = User.objects.using(settings.SLAVE_DB_NAME).filter(user_id=user_id).values_list("nick_name").first()
return nick_name_obj.nick_name
nick_name = nick_name_obj.nick_name if nick_name_obj else ""
return nick_name
except: except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc()) logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return None return ""
def get_is_recommend_flag(self): def get_is_recommend_flag(self):
is_shadow = False is_shadow = False
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment