Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sage Validation
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
Sage Validation
Compare revisions
bc6a3e65ee5b295e1c0fcb232e72a46665e543fa to 7a3fd08335e65129126cd69c218874c7f64157a9
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
geant-swd/sage-validation
Select target project
No results found
7a3fd08335e65129126cd69c218874c7f64157a9
Select Git revision
Branches
develop
master
Tags
0.1
0.10
0.11
0.12
0.2
0.3
0.4
0.5
0.6
0.8
0.9
13 results
Swap
Target
geant-swd/sage-validation
Select target project
geant-swd/sage-validation
1 result
bc6a3e65ee5b295e1c0fcb232e72a46665e543fa
Select Git revision
Branches
develop
master
Tags
0.1
0.10
0.11
0.12
0.2
0.3
0.4
0.5
0.6
0.8
0.9
13 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Change the NC_CC_DEP validation error handling
· a7c98797
Neda Moeini
authored
1 month ago
a7c98797
Merge branch 'enhancement/change-nc-cc-dep-validation' into 'develop'
· 7a3fd083
Neda Moeini
authored
1 month ago
Change the NC_CC_DEP validation error handling See merge request
!9
7a3fd083
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sage_validation/file_validator/forms.py
+2
-2
2 additions, 2 deletions
sage_validation/file_validator/forms.py
test/test_file_validator/test_forms.py
+1
-2
1 addition, 2 deletions
test/test_file_validator/test_forms.py
with
3 additions
and
4 deletions
sage_validation/file_validator/forms.py
View file @
7a3fd083
...
...
@@ -245,10 +245,10 @@ class CSVUploadForm(forms.Form):
nominal_account_name
=
row
.
get
(
nominal_account_field
)
if
not
cc
and
not
dep
and
not
nominal_account_name
:
errors
.
append
(
f
"
Row
{
index
}
: Missing values in
'
{
cc_field
}
'
,
'
{
dep_field
}
'
, and
'
{
nominal_account_field
}
'
.
"
)
continue
if
not
cc
or
not
dep
or
not
nominal_account_name
:
errors
.
append
(
f
"
Row
{
index
}
: Missing values in
'
{
cc_field
}
'
,
'
{
dep_field
}
'
, or
'
{
nominal_account_field
}
'
.
"
)
continue
cc_type
=
cost_centre_map
.
get
(
cc
)
...
...
This diff is collapsed.
Click to expand it.
test/test_file_validator/test_forms.py
View file @
7a3fd083
...
...
@@ -102,14 +102,13 @@ def test_validate_nc_cc_dep_combination_against_meo_sage_account_blank_values(
{
"
NominalAnalysisNominalCostCentre/1
"
:
""
,
"
NominalAnalysisNominalDepartment/1
"
:
""
,
"
NominalAnalysisNominalAccountNumber/1
"
:
""
})
form
=
CSVUploadForm
(
files
=
{
"
file
"
:
modified_file
})
assert
not
form
.
is_valid
()
assert
(
"
Row 1: Missing values in
'
NominalAnalysisNominalCostCentre/1
'
,
'
NominalAnalysisNominalDepartment/1
'
,
"
"
and
'
NominalAnalysisNominalAccountNumber/1
'
.
"
"
or
'
NominalAnalysisNominalAccountNumber/1
'
.
"
in
str
(
form
.
errors
[
"
file
"
][
0
])
)
...
...
This diff is collapsed.
Click to expand it.