testing without ip field
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user