mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 03:17:07 +00:00
refactor: add map marker to context on update
This commit is contained in:
@@ -45,3 +45,16 @@ class OrganisationUpdateView(LoginRequiredMixin, UpdateView):
|
||||
context_object_name = 'organisation'
|
||||
template_name = 'people/organisation/update.html'
|
||||
form_class = forms.OrganisationForm
|
||||
|
||||
def get_context_data(self,
|
||||
**kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
||||
"""Add map marker to context."""
|
||||
context = super().get_context_data(**kwargs)
|
||||
|
||||
context['map_markers'] = [{
|
||||
'name': self.object.name,
|
||||
'lat': self.object.latitude,
|
||||
'lng': self.object.longitude,
|
||||
}]
|
||||
|
||||
return context
|
||||
|
||||
Reference in New Issue
Block a user