testing without ip field

This commit is contained in:
Parsa Nazer
2025-02-21 02:01:01 +03:30
parent 944158fa81
commit 4f0060f0ae
4 changed files with 29 additions and 6 deletions
+2 -2
View File
@@ -112,7 +112,7 @@ class SecurityBreachAttemptAdmin(ModelAdmin, ImportExportModelAdmin):
compressed_fields = True
warn_unsaved_form = True
change_form_template = 'loction_chagne_form.html'
list_display = ['ip', 'country', 'region_name', 'city', 'zip_code', 'isp', 'created_at', 'trys', 'display_viewd']
list_display = ['ip_address', 'country', 'region_name', 'city', 'zip_code', 'isp', 'created_at', 'trys', 'display_viewd']
def change_view(self, request, object_id, form_url='', extra_context=None):
extra_context = extra_context or {}
@@ -120,7 +120,7 @@ class SecurityBreachAttemptAdmin(ModelAdmin, ImportExportModelAdmin):
if obj and obj.lat and obj.lon:
m = Map(location=[obj.lat, obj.lon], zoom_start=10)
Marker([obj.lat, obj.lon], popup=f"Location: {obj.ip}").add_to(m)
Marker([obj.lat, obj.lon], popup=f"Location: {obj.ip_address}").add_to(m)
map_html = m._repr_html_()
extra_context['map_html'] = map_html
return super().change_view(request, object_id, form_url, extra_context)