mirror of
https://github.com/ail-project/ail-framework.git
synced 2024-11-29 17:27:17 +00:00
fix: [chats] fix username meta
This commit is contained in:
parent
207a6524d7
commit
ce989adbd3
3 changed files with 7 additions and 6 deletions
|
@ -307,7 +307,6 @@ def api_get_chat(chat_id, chat_instance_uuid):
|
|||
meta = chat.get_meta({'created_at', 'img', 'info', 'subchannels', 'username'})
|
||||
if meta['username']:
|
||||
meta['username'] = get_username_meta_from_global_id(meta['username'])
|
||||
print()
|
||||
if meta['subchannels']:
|
||||
meta['subchannels'] = get_subchannels_meta_from_global_id(meta['subchannels'])
|
||||
else:
|
||||
|
@ -321,8 +320,8 @@ def api_get_subchannel(chat_id, chat_instance_uuid):
|
|||
meta = subchannel.get_meta({'chat', 'created_at', 'img', 'nb_messages'})
|
||||
if meta['chat']:
|
||||
meta['chat'] = get_chat_meta_from_global_id(meta['chat'])
|
||||
if meta['username']:
|
||||
meta['username']:
|
||||
if meta.get('username'):
|
||||
meta['username'] = get_username_meta_from_global_id(meta['username'])
|
||||
meta['messages'], meta['tags_messages'] = subchannel.get_messages()
|
||||
return meta, 200
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
|
||||
<div class="card my-3">
|
||||
<div class="card-header" style="background-color:#d9edf7;font-size: 15px">
|
||||
<h3 class="text-secondary">{% if subchannel['chat']['name'] %}{{ subchannel['chat']['name'] }} {% else %} {{ subchannel['chat']['id'] }}{% endif %} - {% if subchannel['username'] %}{{ subchannel["username"] }} {% else %} {{ subchannel['name'] }}{% endif %} :</h3> {{ subchannel["id"] }}
|
||||
<h3 class="text-secondary">{% if subchannel['chat']['name'] %}{{ subchannel['chat']['name'] }} {% else %} {{ subchannel['chat']['id'] }}{% endif %} - {% if subchannel['username'] %}{{ subchannel["username"]["id"] }} {% else %} {{ subchannel['name'] }}{% endif %} :</h3> {{ subchannel["id"] }}
|
||||
<ul class="list-group mb-2">
|
||||
<li class="list-group-item py-0">
|
||||
<div class="row">
|
||||
|
@ -88,7 +88,9 @@
|
|||
</td>
|
||||
<td>
|
||||
{% if 'username' in subchannel %}
|
||||
{{ subchannel['username'] }}
|
||||
{% if subchannel['username'] %}
|
||||
{{ subchannel['username']['id'] }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ subchannel['nb_messages'] }}</td>
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<div class="card my-3">
|
||||
|
||||
<div class="card-header" style="background-color:#d9edf7;font-size: 15px">
|
||||
<h4 class="text-secondary">{% if chat['username'] %}{{ chat["username"] }} {% else %} {{ chat['name'] }}{% endif %} :</h4> {{ chat["id"] }}
|
||||
<h4 class="text-secondary">{% if chat['username'] %}{{ chat["username"]["id"] }} {% else %} {{ chat['name'] }}{% endif %} :</h4> {{ chat["id"] }}
|
||||
<ul class="list-group mb-2">
|
||||
<li class="list-group-item py-0">
|
||||
<table class="table">
|
||||
|
|
Loading…
Reference in a new issue