Fixed a bug in _editPost for club_admin and host.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/models/club_admin.py Sat Jan 24 20:44:32 2009 +0000
+++ b/app/soc/views/models/club_admin.py Sat Jan 24 20:51:51 2009 +0000
@@ -97,9 +97,9 @@
def _editPost(self, request, entity, fields):
"""See base.View._editPost().
"""
-
- fields['user'] = fields['link_id']
- fields['link_id'] = fields['user'].link_id
+ if not entity:
+ fields['user'] = fields['link_id']
+ fields['link_id'] = fields['user'].link_id
super(View, self)._editPost(request, entity, fields)
--- a/app/soc/views/models/host.py Sat Jan 24 20:44:32 2009 +0000
+++ b/app/soc/views/models/host.py Sat Jan 24 20:51:51 2009 +0000
@@ -132,9 +132,9 @@
def _editPost(self, request, entity, fields):
"""See base.View._editPost().
"""
-
- fields['user'] = fields['link_id']
- fields['link_id'] = fields['link_id'].link_id
+ if not entity
+ fields['user'] = fields['link_id']
+ fields['link_id'] = fields['link_id'].link_id
super(View, self)._editPost(request, entity, fields)