fix ссылок на авторов в комментариях

This commit is contained in:
admin i 2025-12-03 13:48:31 +03:00
parent 165e2de72f
commit ba1f48c942
5 changed files with 5 additions and 5 deletions

View File

@ -375,7 +375,7 @@
const authorName = commentData.author?.full_name || 'Сотрудник';
const authorId = commentData.author?.id;
const authorLink = authorId
? `/employees/employee/${authorId}/`
? `/employees/${authorId}/`
: '#';
const commentDate = formatDate(commentData.created_at);

View File

@ -321,7 +321,7 @@
const authorId = getAuthorId(comment.author);
if (authorId) {
html += `<a href="/employees/employee/${authorId}/" class="comment-author">${escapeHtml(authorName)}</a>`;
html += `<a href="/employees/${authorId}/" class="comment-author">${escapeHtml(authorName)}</a>`;
} else {
html += `<span class="comment-author">${escapeHtml(authorName)}</span>`;
}

View File

@ -202,7 +202,7 @@
const authorId = comment.author?.id;
if (authorId) {
html += `<a href="/employees/employee/${authorId}/" class="comment-author">${authorName}</a>`;
html += `<a href="/employees/${authorId}/" class="comment-author">${authorName}</a>`;
} else {
html += `<span class="comment-author">${authorName}</span>`;
}

View File

@ -39,7 +39,7 @@ export function initRequestCommentsHandler(options) {
(comment.author.full_name || comment.author.display_name || comment.author.username)) || '—';
const authorId = comment.author?.id;
const authorLink = authorId
? `/employees/employee/${authorId}/`
? `/employees/${authorId}/`
: '#';
const commentDate = esc(comment.created_at || '');

View File

@ -16,7 +16,7 @@ from notifications.services import NotificationService
def main():
"""Создать тестовое уведомление"""
# Получаем первого пользователя
user = Employee.objects.first()
user = Employee.objects.filter(id=1).first()
if not user:
print("❌ Нет пользователей в системе!")