# HG changeset patch # User Pawel Solyga # Date 1225829196 0 # Node ID 92c17629af0ef02f4929be3ea1f05c9078aa575a # Parent 8a7110ad3d82c86c73062b8846f77556fd71a830 Fix wrong redirect when changing partial path or link name. Remove an unnecessary assignment in logic/models/base.py that would generate an error when an entity did not exist. Patch by: Lennard de Rijk Review by: Pawel Solyga diff -r 8a7110ad3d82 -r 92c17629af0e app/soc/logic/models/base.py --- a/app/soc/logic/models/base.py Tue Nov 04 14:09:37 2008 +0000 +++ b/app/soc/logic/models/base.py Tue Nov 04 20:06:36 2008 +0000 @@ -190,8 +190,6 @@ # an entity exist for this link_name, so return that entity return entity - fields = [] - format_text = ugettext_lazy('"%(key)s" is "%(value)s"') msg_pairs = [format_text % {'key': key, 'value': value} diff -r 8a7110ad3d82 -r 92c17629af0e app/soc/views/models/base.py --- a/app/soc/views/models/base.py Tue Nov 04 14:09:37 2008 +0000 +++ b/app/soc/views/models/base.py Tue Nov 04 20:06:36 2008 +0000 @@ -191,6 +191,9 @@ fields = self.collectCleanedFields(form) + # get the old_suffix before editing + old_suffix = self._logic.getKeySuffix(entity) + self._editPost(request, entity, fields) key_fields = self._logic.getKeyFieldsFromDict(fields) @@ -205,7 +208,7 @@ # redirect to (possibly new) location of the entity # (causes 'Profile saved' message to be displayed) return helper.responses.redirectToChangedSuffix( - request, suffix, suffix, + request, old_suffix, suffix, params=params) def editGet(self, request, entity, context):