]> git.parisson.com Git - telemeta.git/commitdiff
fix item page url after item code change (fix #55)
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 11 May 2015 09:28:47 +0000 (11:28 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 11 May 2015 09:28:47 +0000 (11:28 +0200)
telemeta/locale
telemeta/views/item.py

index 3349dd04cf7a3c642217eec584959045452efab2..f27f2cf6cd500e0a6d8e1e6511ed1a9e04d66e44 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3349dd04cf7a3c642217eec584959045452efab2
+Subproject commit f27f2cf6cd500e0a6d8e1e6511ed1a9e04d66e44
index ff1412e03f48ba453243f1a4777a55dae82cdbc3..5ae3f757526b6a50a2a09984bb9940582351c01b 100644 (file)
@@ -459,6 +459,7 @@ class ItemEditView(ItemViewMixin, UpdateWithInlinesView):
     def forms_valid(self, form, inlines):
         messages.info(self.request, ugettext_lazy("You have successfully updated your item."))
         item = form.save()
+        self.code = item.code
         if form.files:
             self.cache_data.delete_item_data(item.code)
             self.cache_export.delete_item_data(item.code)
@@ -472,7 +473,7 @@ class ItemEditView(ItemViewMixin, UpdateWithInlinesView):
         return super(ItemEditView, self).forms_valid(form, inlines)
 
     def get_success_url(self):
-        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.get_object().code})
+        return reverse_lazy('telemeta-item-detail', kwargs={'public_id':self.code})
 
     def get_context_data(self, **kwargs):
         context = super(ItemEditView, self).get_context_data(**kwargs)