From af5fa073a5cf6ecd05dcc46890447930f4d2f328 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 12 Oct 2022 12:27:13 +0200 Subject: Geo: quick add geo action for context records, sites and finds --- archaeological_finds/models_finds.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'archaeological_finds') diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index e1cb2e299..d53f45fdb 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -2304,6 +2304,10 @@ class Find( actions = super(Find, self).get_extra_actions(request) is_locked = hasattr(self, "is_locked") and self.is_locked(request.user) + can_add_geo = self.can_do(request, "add_geovectordata") + if can_add_geo: + if self.base_finds.count() == 1: + actions.append(self.base_finds.all()[0].get_add_geo_action()) can_edit_find = self.can_do(request, "change_find") if can_edit_find and not is_locked: actions += [ -- cgit v1.2.3