We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f6577f commit 6475013Copy full SHA for 6475013
chat/apps.py
@@ -5,3 +5,11 @@ class ChatConfig(AppConfig):
5
default_auto_field = 'django.db.models.BigAutoField'
6
name = 'chat'
7
verbose_name = "گفتگو"
8
+
9
+ def ready(self):
10
+ try:
11
+ from .models import Customize
12
+ if len(Customize.objects.all()) == 0:
13
+ Customize.create_default_fields()
14
+ except Exception:
15
+ pass
chat/views.py
@@ -6,11 +6,10 @@
from django.utils.safestring import mark_safe
from django.contrib.auth.decorators import login_required
from django.utils.text import slugify
-from .models import Chat, Customize
+from .models import Chat
def index(request: object):
- Customize.create_default_fields()
user = request.user
context = {
16
'best_groups': Chat.best_group(),
0 commit comments