Skip to content

Commit

Permalink
Merge branch '53-import-latest-projects' into 'master'
Browse files Browse the repository at this point in the history
Import latest projects

Closes #53

See merge request web-apps/arctic-office-projects-api!33
  • Loading branch information
ludona7 committed Oct 29, 2021
2 parents 5b21b26 + 80e7759 commit b20bcb4
Show file tree
Hide file tree
Showing 5 changed files with 2,651 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ __pycache__
/.idea
*.log
*.csv
arctic_office_projects_api/bulk_importer/json/
/_dev
4 changes: 2 additions & 2 deletions arctic_office_projects_api/bulk_importer/import_grants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def json_valid(filename):
def grant_reference_valid(grant_reference):
patterns = {
'gtr': r'^[A-Z]{2}\/[A-Z0-9]{7}\/\d{1}$',
'other': r'\d{7}'
'other': r'\d{5,7}'
}
for key, pattern in patterns.items():
if re.match(pattern, grant_reference):
Expand All @@ -32,6 +32,6 @@ def import_grants(file):
project['grant-reference']], shell=False)


json_filename = '/usr/src/app/arctic_office_projects_api/bulk_importer/json/projects-2020-08-13.json'
json_filename = '/usr/src/app/arctic_office_projects_api/bulk_importer/json/projects-2021-10-18.json'
if json_valid(json_filename):
import_grants(json_filename)
Loading

0 comments on commit b20bcb4

Please sign in to comment.