Fix handling missing MLs DB.
This commit is contained in:
parent
37b608ab67
commit
c06bc95b36
4 changed files with 20 additions and 10 deletions
|
@ -61,7 +61,8 @@
|
||||||
grantstart grantstop
|
grantstart grantstop
|
||||||
joined destroyed
|
joined destroyed
|
||||||
feestart feestop
|
feestart feestop
|
||||||
phone))
|
phone
|
||||||
|
councilmlstart councilmlstop))
|
||||||
(define ignored-keys '(mail2))
|
(define ignored-keys '(mail2))
|
||||||
|
|
||||||
(define known-keys (append mandatory-keys optional-keys))
|
(define known-keys (append mandatory-keys optional-keys))
|
||||||
|
@ -88,6 +89,9 @@
|
||||||
|
|
||||||
(feestart fee start)
|
(feestart fee start)
|
||||||
(feestop fee stop)
|
(feestop fee stop)
|
||||||
|
|
||||||
|
(councilmlstart councilml start)
|
||||||
|
(councilmlstop councilml stop)
|
||||||
))
|
))
|
||||||
(define start-stop-markers (map car start-stop-markers-lookup))
|
(define start-stop-markers (map car start-stop-markers-lookup))
|
||||||
|
|
||||||
|
@ -114,7 +118,7 @@
|
||||||
(info
|
(info
|
||||||
,(lambda (mr output key value)
|
,(lambda (mr output key value)
|
||||||
(case key
|
(case key
|
||||||
((student suspend member revision chair council grant fee)
|
((student suspend member revision chair council grant fee councilml)
|
||||||
(let* ((res (period-markers->cal-periods value))
|
(let* ((res (period-markers->cal-periods value))
|
||||||
(ok? (car res))
|
(ok? (car res))
|
||||||
(periods0 (cadr res))
|
(periods0 (cadr res))
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
|
|
||||||
;; Which version of mailman to use
|
;; Which version of mailman to use
|
||||||
(define *mailman-version* (make-parameter #f))
|
(define *mailman-version* (make-parameter #f))
|
||||||
(define =mailman-version= 2)
|
(define =mailman-version= 3)
|
||||||
|
|
||||||
;; What is the mailman 3 command
|
;; What is the mailman 3 command
|
||||||
(define *mailman3-bin* (make-parameter #f))
|
(define *mailman3-bin* (make-parameter #f))
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
;; A string is the default, gets converted to boolean at the end of
|
;; A string is the default, gets converted to boolean at the end of
|
||||||
;; loading configuration
|
;; loading configuration
|
||||||
(define *mailman3-sql* (make-parameter #f))
|
(define *mailman3-sql* (make-parameter #f))
|
||||||
(define =mailman3-sql= "0")
|
(define =mailman3-sql= "1")
|
||||||
|
|
||||||
;; The path to SQLite3 DB file
|
;; The path to SQLite3 DB file
|
||||||
(define *mailman3-sql-path* (make-parameter #f))
|
(define *mailman3-sql-path* (make-parameter #f))
|
||||||
|
|
|
@ -37,7 +37,8 @@
|
||||||
(chicken base)
|
(chicken base)
|
||||||
(chicken format)
|
(chicken format)
|
||||||
sqlite3
|
sqlite3
|
||||||
configuration)
|
configuration
|
||||||
|
(chicken condition))
|
||||||
|
|
||||||
;; Thread-local parameter to re-use SQLite3 DB handle for subsequent queries
|
;; Thread-local parameter to re-use SQLite3 DB handle for subsequent queries
|
||||||
(define *cached-mailman3-db* (make-parameter #f))
|
(define *cached-mailman3-db* (make-parameter #f))
|
||||||
|
@ -55,10 +56,15 @@
|
||||||
;; Returns the list of mailman3 mailinglists by querying te
|
;; Returns the list of mailman3 mailinglists by querying te
|
||||||
;; underlying SQLite3 DB directly
|
;; underlying SQLite3 DB directly
|
||||||
(define (list-mailman3-sql-lists)
|
(define (list-mailman3-sql-lists)
|
||||||
(let-values (((stmt _)
|
(handle-exceptions
|
||||||
(prepare (mailman3-db)
|
ex
|
||||||
"SELECT list_name FROM mailinglist")))
|
'()
|
||||||
(map-row identity stmt)))
|
(let ((result
|
||||||
|
(let-values (((stmt _)
|
||||||
|
(prepare (mailman3-db)
|
||||||
|
"SELECT list_name FROM mailinglist")))
|
||||||
|
(map-row identity stmt))))
|
||||||
|
result)))
|
||||||
|
|
||||||
;; Returns a list of email addresses subscribed to given mailinglist
|
;; Returns a list of email addresses subscribed to given mailinglist
|
||||||
(define (list-mailman3-sql-list-members lst)
|
(define (list-mailman3-sql-list-members lst)
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
(caddr c)))
|
(caddr c)))
|
||||||
(brmember-credit mr))
|
(brmember-credit mr))
|
||||||
#:border '(((#:right light) ... none) ...))))
|
#:border '(((#:right light) ... none) ...))))
|
||||||
((suspend student member council chair revision grant)
|
((suspend student member council chair revision grant councilml)
|
||||||
(let* ((pdata (cons (list "Since" "Until")
|
(let* ((pdata (cons (list "Since" "Until")
|
||||||
(map
|
(map
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue