Temporary fix for creating a new user account
This should probably be solved more elegantly, but edit_self is going
to be used soon.
--- a/app/soc/logic/models/user.py Sun Nov 16 23:04:48 2008 +0000
+++ b/app/soc/logic/models/user.py Mon Nov 17 00:01:33 2008 +0000
@@ -74,7 +74,7 @@
}
entity = self.getForFields(properties, unique=True)
- return [entity.account.email()]
+ return [entity.link_name]
def getKeyFieldNames(self):
"""See base.Logic.getKeyFieldNames
@@ -92,7 +92,8 @@
if user:
key_name = user.key().name()
else:
- key_name = self.getKeyNameForFields({'email': account.email()})
+ raise
+ key_name = self.getKeyNameForFields({'link_name': properties['link_name']})
return self.updateOrCreateFromKeyName(properties, key_name)
--- a/app/soc/views/user/profile.py Sun Nov 16 23:04:48 2008 +0000
+++ b/app/soc/views/user/profile.py Mon Nov 17 00:01:33 2008 +0000
@@ -158,7 +158,7 @@
error = out_of_band.ErrorResponse(msg)
return simple.errorResponse(request, page_name, error, template, context)
- user = models.user.logic.updateOrCreateFromAccount(properties, account)
+ user = models.user.logic.updateOrCreateFromFields(properties, {'link_name': new_link_name})
# redirect to /user/profile?s=0
# (causes 'Profile saved' message to be displayed)