]> git.parisson.com Git - teleforma.git/commitdiff
Increase message size up to 512 characters feature/estivale2025
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 28 Apr 2025 12:10:45 +0000 (14:10 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 28 Apr 2025 12:10:45 +0000 (14:10 +0200)
teleforma/migrations/0030_auto_20250428_1124.py [new file with mode: 0644]
teleforma/models/chat.py
teleforma/ws/chat.py

diff --git a/teleforma/migrations/0030_auto_20250428_1124.py b/teleforma/migrations/0030_auto_20250428_1124.py
new file mode 100644 (file)
index 0000000..975fa3a
--- /dev/null
@@ -0,0 +1,24 @@
+# Generated by Django 3.2.25 on 2025-04-28 11:24
+
+from django.db import migrations, models
+import storages.backends.s3
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('teleforma', '0029_merge_0028_auto_20240318_1139_0028_auto_20240415_0414'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='chatmessage',
+            name='message',
+            field=models.CharField(max_length=512, verbose_name='Message'),
+        ),
+        migrations.AlterField(
+            model_name='documentprivate',
+            name='file',
+            field=models.FileField(blank=True, db_column='filename', max_length=1024, storage=storages.backends.s3.S3Storage, upload_to='private/documents/%Y/%m/%d', verbose_name='file'),
+        ),
+    ]
index 145d2cc494b004f254d0220b8ce79ac1c44a1c32..c845fb53ce8b8b4ba3253111603642cdaa3b093f 100644 (file)
@@ -14,7 +14,7 @@ from asgiref.sync import async_to_sync
 class ChatMessage(models.Model):
     """A chat message"""
 
-    message = models.CharField('Message', max_length=255)
+    message = models.CharField('Message', max_length=512)
     room_name = models.CharField('Salon', max_length=255)
     user = models.ForeignKey(
         User, related_name='chat_messages', verbose_name=_('user'), on_delete=models.CASCADE, blank=True, null=True)
index ec15ed0d0115e27600a12fce30a485785bbab80f..0a0324e7891c6f8dd33fa0cf2b184c94c3543c6f 100644 (file)
@@ -36,7 +36,7 @@ class ChatConsumer(AsyncJsonWebsocketConsumer):
 
     # Receive message from user
     async def receive_json(self, content):
-        message_content = content['message'][:255]
+        message_content = content['message'][:512]
         reply_to = await self.get_message_from_id(content.get('replyTo'))
         message = await self.add_message_to_db(self.scope['user'], self.room_name, message_content, reply_to=reply_to)
         # Send message to room group