FossilRepo
Remove chat feature (not ready), fix urls
Commit
8a9a0c95c0e55f5dd7aee6f7d1f3341da0cd07ec83d25f47d65372d7af02e7e1
Parent
2cb9ca6b5196cbc…
3 files changed
-22
-1
-3
D
fossil/chat.py
-22
| --- a/fossil/chat.py | ||
| +++ b/fossil/chat.py | ||
| @@ -1,22 +0,0 @@ | ||
| 1 | -"""Per-project chat backed by Django models. | |
| 2 | - | |
| 3 | -Simple real-time-ish chat using HTMX polling. Messages stored in PostgreSQL. | |
| 4 | -""" | |
| 5 | - | |
| 6 | -from django.contrib.auth.models import User | |
| 7 | -from django.db import models | |
| 8 | - | |
| 9 | - | |
| 10 | -class ChatMessage(models.Model): | |
| 11 | - """A chat message in a project chatroom.""" | |
| 12 | - | |
| 13 | - project = models.ForeignKey("projects.Project", on_delete=models.CASCADE, related_name="chat_messages") | |
| 14 | - user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="chat_messages") | |
| 15 | - message = models.TextField() | |
| 16 | - created_at = models.DateTimeField(auto_now_add=True) | |
| 17 | - | |
| 18 | - class Meta: | |
| 19 | - ordering = ["created_at"] | |
| 20 | - | |
| 21 | - def __str__(self): | |
| 22 | - return f"{self.user.username}: {self.message[:50]}" |
| --- a/fossil/chat.py | |
| +++ b/fossil/chat.py | |
| @@ -1,22 +0,0 @@ | |
| 1 | """Per-project chat backed by Django models. |
| 2 | |
| 3 | Simple real-time-ish chat using HTMX polling. Messages stored in PostgreSQL. |
| 4 | """ |
| 5 | |
| 6 | from django.contrib.auth.models import User |
| 7 | from django.db import models |
| 8 | |
| 9 | |
| 10 | class ChatMessage(models.Model): |
| 11 | """A chat message in a project chatroom.""" |
| 12 | |
| 13 | project = models.ForeignKey("projects.Project", on_delete=models.CASCADE, related_name="chat_messages") |
| 14 | user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="chat_messages") |
| 15 | message = models.TextField() |
| 16 | created_at = models.DateTimeField(auto_now_add=True) |
| 17 | |
| 18 | class Meta: |
| 19 | ordering = ["created_at"] |
| 20 | |
| 21 | def __str__(self): |
| 22 | return f"{self.user.username}: {self.message[:50]}" |
| --- a/fossil/chat.py | |
| +++ b/fossil/chat.py | |
| @@ -1,22 +0,0 @@ | |
-1
| --- fossil/models.py | ||
| +++ fossil/models.py | ||
| @@ -65,8 +65,7 @@ | ||
| 65 | 65 | def __str__(self): |
| 66 | 66 | return f"{self.repository.filename} @ {self.created_at:%Y-%m-%d %H:%M}" if self.created_at else self.repository.filename |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | # Import related models so they're discoverable by Django |
| 70 | -from fossil.chat import ChatMessage # noqa: E402, F401 | |
| 71 | 70 | from fossil.notifications import Notification, ProjectWatch # noqa: E402, F401 |
| 72 | 71 | from fossil.sync_models import GitMirror, SSHKey, SyncLog # noqa: E402, F401 |
| 73 | 72 |
| --- fossil/models.py | |
| +++ fossil/models.py | |
| @@ -65,8 +65,7 @@ | |
| 65 | def __str__(self): |
| 66 | return f"{self.repository.filename} @ {self.created_at:%Y-%m-%d %H:%M}" if self.created_at else self.repository.filename |
| 67 | |
| 68 | |
| 69 | # Import related models so they're discoverable by Django |
| 70 | from fossil.chat import ChatMessage # noqa: E402, F401 |
| 71 | from fossil.notifications import Notification, ProjectWatch # noqa: E402, F401 |
| 72 | from fossil.sync_models import GitMirror, SSHKey, SyncLog # noqa: E402, F401 |
| 73 |
| --- fossil/models.py | |
| +++ fossil/models.py | |
| @@ -65,8 +65,7 @@ | |
| 65 | def __str__(self): |
| 66 | return f"{self.repository.filename} @ {self.created_at:%Y-%m-%d %H:%M}" if self.created_at else self.repository.filename |
| 67 | |
| 68 | |
| 69 | # Import related models so they're discoverable by Django |
| 70 | from fossil.notifications import Notification, ProjectWatch # noqa: E402, F401 |
| 71 | from fossil.sync_models import GitMirror, SSHKey, SyncLog # noqa: E402, F401 |
| 72 |
-3
| --- fossil/urls.py | ||
| +++ fossil/urls.py | ||
| @@ -37,13 +37,10 @@ | ||
| 37 | 37 | path("sync/git/callback/gitlab/", views.oauth_gitlab_callback, name="oauth_gitlab_callback"), |
| 38 | 38 | path("code/raw/<path:filepath>", views.code_raw, name="code_raw"), |
| 39 | 39 | path("code/blame/<path:filepath>", views.code_blame, name="code_blame"), |
| 40 | 40 | path("code/history/<path:filepath>", views.file_history, name="file_history"), |
| 41 | 41 | path("watch/", views.toggle_watch, name="toggle_watch"), |
| 42 | - path("chat/", views.chat_room, name="chat"), | |
| 43 | - path("chat/messages/", views.chat_messages, name="chat_messages"), | |
| 44 | - path("chat/send/", views.chat_send, name="chat_send"), | |
| 45 | 42 | path("timeline/rss/", views.timeline_rss, name="timeline_rss"), |
| 46 | 43 | path("tickets/export/", views.tickets_csv, name="tickets_csv"), |
| 47 | 44 | path("docs/", views.fossil_docs, name="docs"), |
| 48 | 45 | path("docs/<path:doc_path>", views.fossil_doc_page, name="doc_page"), |
| 49 | 46 | ] |
| 50 | 47 |
| --- fossil/urls.py | |
| +++ fossil/urls.py | |
| @@ -37,13 +37,10 @@ | |
| 37 | path("sync/git/callback/gitlab/", views.oauth_gitlab_callback, name="oauth_gitlab_callback"), |
| 38 | path("code/raw/<path:filepath>", views.code_raw, name="code_raw"), |
| 39 | path("code/blame/<path:filepath>", views.code_blame, name="code_blame"), |
| 40 | path("code/history/<path:filepath>", views.file_history, name="file_history"), |
| 41 | path("watch/", views.toggle_watch, name="toggle_watch"), |
| 42 | path("chat/", views.chat_room, name="chat"), |
| 43 | path("chat/messages/", views.chat_messages, name="chat_messages"), |
| 44 | path("chat/send/", views.chat_send, name="chat_send"), |
| 45 | path("timeline/rss/", views.timeline_rss, name="timeline_rss"), |
| 46 | path("tickets/export/", views.tickets_csv, name="tickets_csv"), |
| 47 | path("docs/", views.fossil_docs, name="docs"), |
| 48 | path("docs/<path:doc_path>", views.fossil_doc_page, name="doc_page"), |
| 49 | ] |
| 50 |
| --- fossil/urls.py | |
| +++ fossil/urls.py | |
| @@ -37,13 +37,10 @@ | |
| 37 | path("sync/git/callback/gitlab/", views.oauth_gitlab_callback, name="oauth_gitlab_callback"), |
| 38 | path("code/raw/<path:filepath>", views.code_raw, name="code_raw"), |
| 39 | path("code/blame/<path:filepath>", views.code_blame, name="code_blame"), |
| 40 | path("code/history/<path:filepath>", views.file_history, name="file_history"), |
| 41 | path("watch/", views.toggle_watch, name="toggle_watch"), |
| 42 | path("timeline/rss/", views.timeline_rss, name="timeline_rss"), |
| 43 | path("tickets/export/", views.tickets_csv, name="tickets_csv"), |
| 44 | path("docs/", views.fossil_docs, name="docs"), |
| 45 | path("docs/<path:doc_path>", views.fossil_doc_page, name="doc_page"), |
| 46 | ] |
| 47 |