--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -181,9 +181,9 @@
         self.config.options['show_right_bar'] = True
         super(ForgeWikiApp, self).install(project)
         # Setup permissions
-        role_developer = M.ProjectRole.query.get(name='Developer')._id
-        role_auth = M.ProjectRole.query.get(name='*authenticated')._id
-        role_anon = M.ProjectRole.query.get(name='*anonymous')._id
+        role_developer = M.ProjectRole.by_name('Developer')._id
+        role_auth = M.ProjectRole.by_name('*authenticated')._id
+        role_anon = M.ProjectRole.by_name('*anonymous')._id
         self.config.acl.update(
             configure=c.project.roleids_with_permission('tool'),
             read=c.project.roleids_with_permission('read'),
@@ -571,7 +571,7 @@
             require(has_artifact_access('create'))
             self.page = WM.Page.upsert(self.title)
             self.page.viewable_by = ['all']
-            for u in M.ProjectRole.query.find({'name':'Admin'}).first().users_with_role():
+            for u in M.ProjectRole.by_name('Admin').users_with_role():
                 self.page.subscribe(user=u)
         require(has_artifact_access('edit', self.page))
         if tags: tags = tags.split(',')