Revert "Add support for user correction"
This reverts commit bac722a749
.
There are 2 user profiles that mix with each other because of the same
email re-used by other person. The proposed change was intended to fix
this, but it does not. All it does is update of user profile after
record processing, but at that moment records already refer to
the wrong person. The correct solution is to somehow restrict usage
of email (e.g. by date) or at least restrict mapping of particular
user profiles.
Change-Id: I1c37bd9778d740d5095f08885bb3cb63a656a604
This commit is contained in:
@@ -66,44 +66,6 @@ class TestUserProcessor(testtools.TestCase):
|
||||
# static flag must present
|
||||
self.assertTrue(updated_user.get('static'))
|
||||
|
||||
def test_update_user_with_correction(self):
|
||||
user_correction = {
|
||||
"user_id": "user",
|
||||
"correction_comment": "Reset emails",
|
||||
"emails": ["updated@smith.com"]
|
||||
}
|
||||
|
||||
stored_user = {
|
||||
"launchpad_id": "user",
|
||||
"companies": [
|
||||
{
|
||||
"company_name": "Rackspace",
|
||||
"end_date": "2011-Nov-20"
|
||||
},
|
||||
{
|
||||
"company_name": "IBM",
|
||||
"end_date": None
|
||||
}
|
||||
],
|
||||
"user_name": "Johnny",
|
||||
"emails": ["obsoleted@smith.com"],
|
||||
"corrections": ["Old correction"],
|
||||
"static": True
|
||||
}
|
||||
|
||||
updated_user = user_processor.update_user_profile(stored_user,
|
||||
user_correction,
|
||||
is_correction=True)
|
||||
|
||||
# reset emails from correction
|
||||
self.assertEqual(set(user_correction['emails']),
|
||||
set(updated_user['emails']))
|
||||
# save correction history
|
||||
self.assertEqual(updated_user['corrections'],
|
||||
["Old correction", "Reset emails"])
|
||||
# static flag must present
|
||||
self.assertTrue(updated_user.get('static'))
|
||||
|
||||
def test_update_user_unknown_user(self):
|
||||
user = {
|
||||
"launchpad_id": "user",
|
||||
|
Reference in New Issue
Block a user