diff --git a/data/templates/view_person_detail.html b/data/templates/view_person_detail.html
index 7ca6a692b..6c28f5227 100644
--- a/data/templates/view_person_detail.html
+++ b/data/templates/view_person_detail.html
@@ -63,7 +63,7 @@
|
{{personform.gender_type.label}}: |
- {% render personform.gender_type user action None "/person/?search=gender%%3D%s" personform.model.gender_type %} |
+ {% render personform.gender_type user action None "/person/?search=gender%%3D%s" "personform.model.gender_type" %} |
{{personform.gramps_id.label}}: |
{% render personform.gramps_id user action %} |
{{personform.tags.label}}: |
diff --git a/gramps/webapp/grampsdb/forms.py b/gramps/webapp/grampsdb/forms.py
index 93e007141..2f0798b05 100644
--- a/gramps/webapp/grampsdb/forms.py
+++ b/gramps/webapp/grampsdb/forms.py
@@ -41,6 +41,9 @@ class PersonForm(forms.ModelForm):
exclude = ["death", "birth", "handle", "birth_ref_index",
"death_ref_index", "families", "parent_families",
"cache"]
+ def save(self, *args, **kwargs):
+ self.instance.save_cache_q = kwargs.pop("save_cache", True)
+ return super().save(*args, **kwargs)
class NameForm(forms.ModelForm):
class Meta:
diff --git a/gramps/webapp/grampsdb/models.py b/gramps/webapp/grampsdb/models.py
index d92cdd70f..d870ca5bd 100644
--- a/gramps/webapp/grampsdb/models.py
+++ b/gramps/webapp/grampsdb/models.py
@@ -451,11 +451,7 @@ class Tag(models.Model):
models.Model.save(self)
def save(self, *args, **kwargs):
- save_cache = True
- if "save_cache" in kwargs:
- save_cache = kwargs["save_cache"]
- del kwargs["save_cache"]
- if save_cache:
+ if self.save_cache_q:
self.cache = self.make_cache()
models.Model.save(self, *args, **kwargs) # save to db
@@ -539,11 +535,7 @@ class PrimaryObject(models.Model):
models.Model.save(self)
def save(self, *args, **kwargs):
- save_cache = True
- if "save_cache" in kwargs:
- save_cache = kwargs["save_cache"]
- del kwargs["save_cache"]
- if save_cache:
+ if self.save_cache_q:
self.cache = self.make_cache()
models.Model.save(self, *args, **kwargs) # save to db
@@ -601,10 +593,7 @@ class Person(PrimaryObject):
def save(self, *args, **kwargs):
from gramps.webapp.utils import probably_alive
- if "save_cache" in kwargs:
- compute_probably_alive = kwargs["save_cache"]
- else:
- compute_probably_alive = True
+ compute_probably_alive = self.save_cache_q
PrimaryObject.save(self, *args, **kwargs)
# expensive! only do this if also saving cache
if compute_probably_alive: