log events chnages

This commit is contained in:
Faheedkhan 2025-06-11 15:15:14 +03:00
parent 90e6af08d8
commit 9596c304bc
3 changed files with 13 additions and 9 deletions

View File

@ -8276,7 +8276,7 @@ def user_management(request):
class AuditLogDashboardView(TemplateView):
template_name = 'admin_management/audit_log_dashboard.html'
paginate_by = 20
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
@ -8299,7 +8299,10 @@ class AuditLogDashboardView(TemplateView):
if event.changed_fields:
try:
print(f"Debugging CRUDEvent ID: {event.id}, User: {event.user}, Model: {event.content_type.model}")
print(f"Raw event.changed_fields: '{event.changed_fields}' (Type: {type(event.changed_fields)})")
changes = json.loads(event.changed_fields)
print(changes)
for field_name, values in changes.items():
# Ensure values are lists and have at least two elements
old_value = values[0] if isinstance(values, list) and len(values) > 0 else None

View File

@ -36,33 +36,33 @@
</ul>
<div class="tab-content p-3 border border-top-0 rounded-bottom" id="accountTypeTabsContent">
<!-- Tab -->
<!-- modellogs Tab -->
<div class="tab-pane fade show active" id="modellogs" role="tabpanel" aria-labelledby="modellogs-tab">
{% include "partials/search_box.html" %}
{% include "admin_management/model_logs.html" %}
</div>
<!-- COGS Tab -->
<!-- authlogs Tab -->
<div class="tab-pane fade" id="authlogs" role="tabpanel" aria-labelledby="authlogs-tab">
{% include "partials/search_box.html" %}
{% include "admin_management/auth_logs.html" %}
</div>
<!-- Capital Tab -->
{% comment %} <div class="tab-pane fade" id="requestslog" role="tabpanel" aria-labelledby="requestslog-tab">
<!-- requestslog Tab -->
<div class="tab-pane fade" id="requestslog" role="tabpanel" aria-labelledby="requestslog-tab">
{% include "partials/search_box.html" %}
{% include "admin_management/request_logs.html" %}
</div> {% endcomment %}
</div>
<div class="tab-pane fade" id="requestslog" role="tabpanel" aria-labelledby="requestslog-tab">
<p>Hello from Request Logs tab!</p>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -25,6 +25,7 @@
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p>No authentication audit events found.</p>