diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-10-12 12:27:13 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-12-12 12:23:18 +0100 |
commit | af5fa073a5cf6ecd05dcc46890447930f4d2f328 (patch) | |
tree | 76c1b80d2286509fc3c4474e53955d417fbcfd69 /archaeological_finds/models_finds.py | |
parent | 5bc393a2138befe7ad7e17565979ae571d632f45 (diff) | |
download | Ishtar-af5fa073a5cf6ecd05dcc46890447930f4d2f328.tar.bz2 Ishtar-af5fa073a5cf6ecd05dcc46890447930f4d2f328.zip |
Geo: quick add geo action for context records, sites and finds
Diffstat (limited to 'archaeological_finds/models_finds.py')
-rw-r--r-- | archaeological_finds/models_finds.py | 4 |
1 files changed, 4 insertions, 0 deletions
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 += [ |