Gerrit approval records have a 'by' field

We need to look one level deeper.

Change-Id: I81dbc316ded86739fd7d5413beb7a51a4e57e4f5
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index a74ad17..9787ae1 100755
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -221,11 +221,13 @@
         approval = {'description': self.categories[category][0],
                     'type': category,
                     'value': str(value),
-                    'username': username,
-                    'email': username + '@example.com',
+                    'by': {
+                        'username': username,
+                        'email': username + '@example.com',
+                    },
                     'grantedOn': int(granted_on)}
         for i, x in enumerate(self.patchsets[-1]['approvals'][:]):
-            if x['username'] == username and x['type'] == category:
+            if x['by']['username'] == username and x['type'] == category:
                 del self.patchsets[-1]['approvals'][i]
         self.patchsets[-1]['approvals'].append(approval)
         event = {'approvals': [approval],
diff --git a/zuul/model.py b/zuul/model.py
index 2ae2e2f..5da9cef 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -1023,12 +1023,13 @@
             matches_approval = False
             for approval in change.approvals:
                 found_approval = True
+                by = approval.get('by', {})
                 for k, v in rapproval.items():
                     if k == 'username':
-                        if (approval['username'] != v):
+                        if (by.get('username', '') != v):
                             found_approval = False
                     elif k == 'email-filter':
-                        if (not v.search(approval['email'])):
+                        if (not v.search(by.get('email', ''))):
                             found_approval = False
                     elif k == 'newer-than':
                         t = now - v