From ae51da0277955dc3a05220e43d11b3de7b89de8e Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 24 Oct 2022 20:12:21 +0100 Subject: [PATCH] refactor nera: call string-is-nil-or-empty? from validation package. This is part of a multi-part commit to port the string-is-nil-or-empty? function from the utils package to the validation package. The code has a lot of 'utils:string-is-nil-or-empty?' dotted around so this took a few commits to port. There is a chance I've missed it in some obsure places so don't be surprised if you see a future commit relaying something similar to this one. --- src/nera.lisp | 9 +++++---- src/utils.lisp | 1 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nera.lisp b/src/nera.lisp index 68f8b46..e8d6ede 100644 --- a/src/nera.lisp +++ b/src/nera.lisp @@ -6,6 +6,7 @@ #:hermetic #:ritherdon-archive.db #:utils + #:validation #:user #:pages #:files @@ -142,9 +143,9 @@ (with-connection (db) (let ((user-to-update (mito:find-dao 'user:user :username username))) - (if (not (utils:string-is-nil-or-empty? display-name)) + (if (not (validation:string-is-nil-or-empty? display-name)) (setf (user::display-name-of user-to-update) display-name)) - (if (not (utils:string-is-nil-or-empty? new-password)) + (if (not (validation:string-is-nil-or-empty? new-password)) (setf (user::password-of user-to-update) (hermetic::hash new-password))) (mito:save-dao user-to-update)))) @@ -196,9 +197,9 @@ editted article entry as the first item in the list.." "Add a new `PAGE' to the database." (with-connection (db) (let ((page-to-update (mito:find-dao 'page :id id))) - (if (not (utils:string-is-nil-or-empty? title)) + (if (not (validation:string-is-nil-or-empty? title)) (setf (pages::title-of page-to-update) title)) - (if (not (utils:string-is-nil-or-empty? slug)) + (if (not (validation:string-is-nil-or-empty? slug)) (setf (pages::slug-of page-to-update) slug)) (if (not (null nav-menu)) (setf (pages::enable-nav-menu-p page-to-update) nav-menu)) diff --git a/src/utils.lisp b/src/utils.lisp index 9cfaf52..56d22a7 100644 --- a/src/utils.lisp +++ b/src/utils.lisp @@ -7,7 +7,6 @@ #:app-constants #:storage) (:export #:request-params - #:string-is-nil-or-empty? #:separate-files-in-web-request #:set-alert #:get-alert