allura
Revisão | f3e3ff65de5fc6b1c56035b4ce4abedb5d981267 (tree) |
---|---|
Hora | 2011-06-22 23:44:48 |
Autor | Rick Copeland <rcopeland@geek...> |
Commiter | Rick Copeland |
[#2078] Some fixes to deal with Zarkov crazy classes being included in the data model
Signed-off-by: Rick Copeland <rcopeland@geek.net>
@@ -3,7 +3,7 @@ from collections import defaultdict | ||
3 | 3 | |
4 | 4 | from pylons import c, g |
5 | 5 | |
6 | -from ming.orm import mapper, Mapper | |
6 | +from ming.orm import mapper, session, Mapper | |
7 | 7 | from ming.orm.declarative import MappedClass |
8 | 8 | |
9 | 9 | import allura.tasks.index_tasks |
@@ -121,7 +121,7 @@ class EnsureIndexCommand(base.Command): | ||
121 | 121 | base.log.info('... skipping abstract class %s', cls) |
122 | 122 | continue |
123 | 123 | base.log.info('... for class %s', cls) |
124 | - if cls.__mongometa__.session in ( | |
124 | + if session(cls) in ( | |
125 | 125 | M.main_orm_session, M.repository_orm_session): |
126 | 126 | idx = main_indexes[cname] |
127 | 127 | else: |
@@ -0,0 +1,29 @@ | ||
1 | +{% set hide_left_bar=False %} | |
2 | +{% extends g.theme.master %} | |
3 | + | |
4 | +{% block title %}Forge Site Admin{% endblock %} | |
5 | +{% block header %}Forge Site Admin{% endblock %} | |
6 | + | |
7 | +{% block nav_menu %} | |
8 | +<div class="column grid_1"> | |
9 | + <img src="{{g.forge_static('images/project_default.png')}}" class="project_icon" alt=""/> | |
10 | +</div> | |
11 | +<div class="column grid_9"> | |
12 | + <h1 class="project_title">Site Admin</h1> | |
13 | +</div> | |
14 | +<div class="column grid_2"> </div> | |
15 | +{% endblock %} | |
16 | + | |
17 | +{% block sidebar_menu %} | |
18 | +<div id="sidebar"> | |
19 | + <div> </div> | |
20 | + <ul> | |
21 | + <li class="{{page=='index' and 'active' or ''}}"><a href="."><b data-icon="{{g.icons['admin'].char}}" class="ico {{g.icons['admin'].css}}"></b>Home</a></li> | |
22 | + <li class="{{page=='stats' and 'active' or ''}}"><a href="stats"><b data-icon="{{g.icons['stats'].char}}" class="ico {{g.icons['stats'].css}}"></b>Stats</a></li> | |
23 | + <li class="{{page=='cpa_stats' and 'active' or ''}}"><a href="cpa_stats"><b data-icon="{{g.icons['stats'].char}}" class="ico {{g.icons['stats'].css}}"></b>CPA Stats</a></li> | |
24 | + <li class="{{page=='api_tickets' and 'active' or ''}}"><a href="api_tickets"><b data-icon="{{g.icons['admin'].char}}" class="ico {{g.icons['admin'].css}}"></b>API Tickets</a></li> | |
25 | + </ul> | |
26 | +</div> | |
27 | +{% endblock %} | |
28 | + | |
29 | +{% block inner_grid %}{% endblock %} |
@@ -37,20 +37,6 @@ class TestSiteAdmin(TestController): | ||
37 | 37 | assert headers[4].contents[0] == 'Template' |
38 | 38 | assert headers[5].contents[0] == 'Total Time' |
39 | 39 | |
40 | - def test_cpa(self): | |
41 | - r = self.app.get('/nf/admin/cpa_stats', extra_environ=dict( | |
42 | - username='test-user'), status=403) | |
43 | - r = self.app.get('/nf/admin/cpa_stats', extra_environ=dict( | |
44 | - username='root')) | |
45 | - assert 'Forge Site Admin' in r.html.find('h2',{'class':'dark title'}).contents[0] | |
46 | - stats_table = r.html.find('table') | |
47 | - headers = stats_table.findAll('th') | |
48 | - assert headers[0].contents[0] == 'Tool Name' | |
49 | - assert headers[1].contents[0] == 'Class Name' | |
50 | - assert headers[2].contents[0] == 'Create' | |
51 | - assert headers[3].contents[0] == 'Modify' | |
52 | - assert headers[4].contents[0] == 'Delete' | |
53 | - | |
54 | 40 | def test_tickets_access(self): |
55 | 41 | r = self.app.get('/nf/admin/api_tickets', extra_environ=dict( |
56 | 42 | username='test-user'), status=403) |
@@ -64,7 +64,7 @@ def get_repo_collections(): | ||
64 | 64 | res = {} |
65 | 65 | for m in Mapper.all_mappers(): |
66 | 66 | cls = m.mapped_class |
67 | - cname = cls.__mongometa__.name | |
67 | + cname = m.collection.m.collection_name | |
68 | 68 | if issubclass(cls, M.Repository): res[cname] = cls |
69 | 69 | return res |
70 | 70 |