Add a signal to keep direct-message chat name and icon in sync when a user updates their username or avatar, and register it in AppConfig.ready. Also initialize a DM chat's name/icon on creation from the other member's username/avatar if those fields are missing, saving only the changed fields.
12 lines
238 B
Python
12 lines
238 B
Python
from django.apps import AppConfig
|
|
|
|
|
|
class ChatConfig(AppConfig):
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
name = 'social.chat'
|
|
|
|
label = "chat"
|
|
|
|
def ready(self):
|
|
import social.chat.signals # noqa: F401
|