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
Commits
2c2fe99c
Commit
2c2fe99c
authored
6 days ago
by
Neda Moeini
Browse files
Options
Downloads
Patches
Plain Diff
FINSUP-26
parent
01039213
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sage_validation/file_validator/forms.py
+11
-5
11 additions, 5 deletions
sage_validation/file_validator/forms.py
with
11 additions
and
5 deletions
sage_validation/file_validator/forms.py
+
11
−
5
View file @
2c2fe99c
"""
Forms for the file_validator app.
"""
import
csv
import
re
from
collections.abc
import
Sequence
from
typing
import
ClassVar
...
...
@@ -169,13 +170,18 @@ class CSVUploadForm(forms.Form):
continue
pl_account_name
=
account_code_map
.
get
(
account_code
)
if
pl_account_name
is
None
:
errors
.
append
(
f
"
Row
{
index
}
:
'
AccountNumber
'
{
account_code
}
does not exist in PL Account Codes.
"
)
elif
pl_account_name
not
in
nominal
:
errors
.
append
(
f
"
Row
{
index
}
:
'
AccountNumber
'
must match
'
{
pl_account_name
}
'
in
"
f
"'
NominalAnalysisNominalAnalysisNarrative/1
'
, but found
'
{
nominal
}
'
.
"
)
else
:
# Remove 'Soldo' and any hyphens from the PL account name. This is for credit card accounts.
revised_pl_account_name
=
re
.
sub
(
r
"
\bSoldo\b|\s*-\s*
"
,
""
,
pl_account_name
,
flags
=
re
.
IGNORECASE
).
strip
()
if
revised_pl_account_name
not
in
nominal
:
errors
.
append
(
f
"
Row
{
index
}
:
'
AccountNumber
'
must match
'
{
revised_pl_account_name
}
'
in
"
f
"'
NominalAnalysisNominalAnalysisNarrative/1
'
, but found
'
{
nominal
}
'
.
"
)
return
errors
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment