Fossil SCM

Make sure the MODREQ table exists before using it in the "modreq" webpage.

drh 2012-11-02 02:34 UTC moderation
Commit def256a23be85d32841e731bc35f426381eb5f24
1 file changed +10 -8
+10 -8
--- src/moderate.c
+++ src/moderate.c
@@ -150,15 +150,17 @@
150150
151151
login_check_credentials();
152152
if( !g.perm.RdWiki && !g.perm.RdTkt ){ login_needed(); return; }
153153
style_header("Pending Moderation Requests");
154154
@ <h2>All Pending Moderation Requests</h2>
155
- blob_init(&sql, timeline_query_for_www(), -1);
156
- blob_appendf(&sql,
157
- " AND event.objid IN (SELECT objid FROM modreq)"
158
- " ORDER BY event.mtime DESC"
159
- );
160
- db_prepare(&q, blob_str(&sql));
161
- www_print_timeline(&q, 0, 0, 0, 0);
162
- db_finalize(&q);
155
+ if( moderation_table_exists() ){
156
+ blob_init(&sql, timeline_query_for_www(), -1);
157
+ blob_appendf(&sql,
158
+ " AND event.objid IN (SELECT objid FROM modreq)"
159
+ " ORDER BY event.mtime DESC"
160
+ );
161
+ db_prepare(&q, blob_str(&sql));
162
+ www_print_timeline(&q, 0, 0, 0, 0);
163
+ db_finalize(&q);
164
+ }
163165
style_footer();
164166
}
165167
--- src/moderate.c
+++ src/moderate.c
@@ -150,15 +150,17 @@
150
151 login_check_credentials();
152 if( !g.perm.RdWiki && !g.perm.RdTkt ){ login_needed(); return; }
153 style_header("Pending Moderation Requests");
154 @ <h2>All Pending Moderation Requests</h2>
155 blob_init(&sql, timeline_query_for_www(), -1);
156 blob_appendf(&sql,
157 " AND event.objid IN (SELECT objid FROM modreq)"
158 " ORDER BY event.mtime DESC"
159 );
160 db_prepare(&q, blob_str(&sql));
161 www_print_timeline(&q, 0, 0, 0, 0);
162 db_finalize(&q);
 
 
163 style_footer();
164 }
165
--- src/moderate.c
+++ src/moderate.c
@@ -150,15 +150,17 @@
150
151 login_check_credentials();
152 if( !g.perm.RdWiki && !g.perm.RdTkt ){ login_needed(); return; }
153 style_header("Pending Moderation Requests");
154 @ <h2>All Pending Moderation Requests</h2>
155 if( moderation_table_exists() ){
156 blob_init(&sql, timeline_query_for_www(), -1);
157 blob_appendf(&sql,
158 " AND event.objid IN (SELECT objid FROM modreq)"
159 " ORDER BY event.mtime DESC"
160 );
161 db_prepare(&q, blob_str(&sql));
162 www_print_timeline(&q, 0, 0, 0, 0);
163 db_finalize(&q);
164 }
165 style_footer();
166 }
167

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button