# HG changeset patch # User Alexandre Segura # Date 1487777228 -3600 # Node ID 6f901f3b151042cc738f3ba4b90ab39a41577f4a # Parent ebec1d59dc74043501c7bd052d122be457b0235d Redirect to annotation using hash. diff -r ebec1d59dc74 -r 6f901f3b1510 src/iconolab/views/objects.py --- a/src/iconolab/views/objects.py Wed Feb 22 15:41:07 2017 +0100 +++ b/src/iconolab/views/objects.py Wed Feb 22 16:27:08 2017 +0100 @@ -431,7 +431,7 @@ tags_json = annotation_form.cleaned_data['tags'] new_annotation = Annotation.objects.create_annotation(author, image, title=title, description=description, fragment=fragment, tags_json=tags_json) redirect_url = reverse('image_detail', kwargs={'collection_name': collection_name, 'image_guid': image_guid}) - return RedirectView.as_view(url=redirect_url)(request) + return redirect(redirect_url + '#' + str(new_annotation.annotation_guid)) context = self.get_context_data(**kwargs) context['image'] = image context['form'] = annotation_form @@ -594,7 +594,7 @@ revision_tags_json = annotation_form.cleaned_data['tags'] new_revision = annotation.make_new_revision(revision_author, revision_title, revision_description, revision_fragment, revision_tags_json) redirect_url = reverse('image_detail', kwargs={'collection_name': collection_name, 'image_guid': image_guid}) - return RedirectView.as_view(url=redirect_url)(request) + return redirect(redirect_url + '#' + str(annotation.annotation_guid)) context = self.get_context_data(**kwargs) context['image'] = image context['form'] = annotation_form