django-loci icon indicating copy to clipboard operation
django-loci copied to clipboard

[bug] ObjectLocation admin doesn't work in readonly mode

Open nemesifier opened this issue 2 years ago • 2 comments

When a user has only view permission, the map doesn't work because the JS fails (it was not tested in this scenario).

nemesifier avatar Oct 08 '21 17:10 nemesifier

When a user has only view permission, the map doesn't work because the JS fails (it was not tested in this scenario).

I don't think it is due to the JS. If a user doesn't have change permissions, then these fields are not shown in ObjectLocation admin

I also found something in Django admin where we might found a possible fix :point_down: https://github.com/django/django/blob/cf79f92abee2ff5fd4fdcc1a124129a9773805b8/django/contrib/admin/options.py#L674

devkapilbansal avatar Dec 13 '21 20:12 devkapilbansal

I also found something in Django admin where we might found a possible fix https://github.com/django/django/blob/cf79f92abee2ff5fd4fdcc1a124129a9773805b8/django/contrib/admin/options.py#L674

That only affects ModelAdmin and not InlineAdmin.

I created a simple demo project with our use case and also posted in django-users mailing list for help.

Also, django-leaflet does not render map for view only permissions: https://github.com/makinacorpus/django-leaflet/issues/85

pandafy avatar Jan 03 '22 12:01 pandafy