mirror of
https://github.com/penpot/penpot.git
synced 2025-02-12 10:09:03 -05:00
✨ Add file soft validation support
This commit is contained in:
parent
ac3d7f00d5
commit
d90e184b4d
3 changed files with 16 additions and 2 deletions
|
@ -28,7 +28,8 @@ export PENPOT_FLAGS="\
|
|||
enable-access-tokens \
|
||||
disable-file-validation \
|
||||
disable-file-schema-validation \
|
||||
enable-soft-file-schema-validation";
|
||||
enable-soft-file-schema-validation \
|
||||
enable-soft-file-validation";
|
||||
|
||||
# export PENPOT_DATABASE_URI="postgresql://172.17.0.1:5432/penpot"
|
||||
# export PENPOT_DATABASE_USERNAME="penpot"
|
||||
|
|
|
@ -19,7 +19,8 @@ export PENPOT_FLAGS="\
|
|||
enable-access-tokens \
|
||||
disable-file-validation \
|
||||
disable-file-schema-validation \
|
||||
enable-soft-file-schema-validation";
|
||||
enable-soft-file-schema-validation \
|
||||
enable-soft-file-validation";
|
||||
|
||||
# Initialize MINIO config
|
||||
mc alias set penpot-s3/ http://minio:9000 minioadmin minioadmin
|
||||
|
|
|
@ -275,6 +275,15 @@
|
|||
|
||||
file)
|
||||
|
||||
(defn- soft-validate-file!
|
||||
[file libs]
|
||||
(try
|
||||
(val/validate-file! file libs)
|
||||
(catch Throwable cause
|
||||
(l/error :hint "file validation error"
|
||||
:cause cause)))
|
||||
file)
|
||||
|
||||
(defn- update-file-data
|
||||
[conn file changes skip-validate]
|
||||
(let [file (update file :data (fn [data]
|
||||
|
@ -309,6 +318,9 @@
|
|||
(not skip-validate))
|
||||
(val/validate-file-schema!))
|
||||
|
||||
(cond-> (contains? cf/flags :soft-file-validation)
|
||||
(soft-validate-file! libs))
|
||||
|
||||
(cond-> (contains? cf/flags :soft-file-schema-validation)
|
||||
(soft-validate-file-schema!))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue