Revision: 3811 Author: hans URL: http://bknr.net/trac/changeset/3811
Wait for certificate generation in CMS.
U trunk/projects/bos/web/sponsor-handlers.lisp
Modified: trunk/projects/bos/web/sponsor-handlers.lisp =================================================================== --- trunk/projects/bos/web/sponsor-handlers.lisp 2008-09-05 14:23:27 UTC (rev 3810) +++ trunk/projects/bos/web/sponsor-handlers.lisp 2008-09-05 15:03:22 UTC (rev 3811) @@ -327,10 +327,19 @@ (defmethod handle-object-form ((handler cert-regen-handler) (action (eql :regenerate)) (contract contract)) (with-query-params (name address language) (contract-issue-cert contract name :address address :language language)) - (with-bos-cms-page (:title "Certificate has been recreated") - (html "The certificates for the sponsor have been re-generated." :br) - (unless (contract-download-only-p contract) - (mail-print-pdf contract) - (html "The print certificate has been sent to the relevant BOS office address by email." :br)) - (let ((sponsor (contract-sponsor contract))) - (cmslink #?"edit-sponsor/$((store-object-id sponsor))" "return to sponsor")))) \ No newline at end of file + (redirect #?"/cert-regen/$((store-object-id contract))?action=wait") + +(defmethod handle-object-form ((handler cert-regen-handler) (action (eql :wait)) (contract contract)) + (if (and (contract-certificates-generated-p contract) + (not (contract-tree-needs-update-p))) + (with-bos-cms-page (:title "Certificate has been recreated") + (html "The certificates for the sponsor have been re-generated." :br) + (unless (contract-download-only-p contract) + (mail-print-pdf contract) + (html "The print certificate has been sent to the relevant BOS office address by email." :br)) + (let ((sponsor (contract-sponsor contract))) + (cmslink #?"edit-sponsor/$((store-object-id sponsor))" "return to sponsor"))) + (html (:html + (:head ((:meta :http-equiv "refresh" + :content #?"2; url=/cert-regen/$((store-object-id contract))?action=wait"))) + (:body "waiting for certificate to be regenerated..."))))) \ No newline at end of file