feat: Make sure location gets refreshed when editing AN
This commit is contained in:
parent
ac139af706
commit
c8ef310a71
@ -119,6 +119,10 @@ def adoption_notice_edit(request, adoption_notice_id):
|
|||||||
|
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
adoption_notice_instance = form.save()
|
adoption_notice_instance = form.save()
|
||||||
|
"""Search the location given in the location string and add it to the adoption notice"""
|
||||||
|
location = Location.get_location_from_string(adoption_notice_instance.location_string)
|
||||||
|
adoption_notice_instance.location = location
|
||||||
|
adoption_notice_instance.save()
|
||||||
return redirect(reverse("adoption-notice-detail", args=[adoption_notice_instance.pk], ))
|
return redirect(reverse("adoption-notice-detail", args=[adoption_notice_instance.pk], ))
|
||||||
else:
|
else:
|
||||||
form = AdoptionNoticeForm(instance=adoption_notice)
|
form = AdoptionNoticeForm(instance=adoption_notice)
|
||||||
|
Loading…
Reference in New Issue
Block a user