Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk Import / Vessel Events #637

Merged
merged 3 commits into from
Jan 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions roundabout/ooi_ci_tools/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from celery import shared_task
from dateutil import parser
from django.core.cache import cache
from django.db import transaction
from roundabout.ooi_ci_tools.forms import validate_reference_designator
from roundabout.parts.models import Part, PartType, Revision
from sigfig import round
Expand Down Expand Up @@ -364,6 +365,7 @@ def parse_cruise_files(self):
cruise_start_date = parser.parse(row['cruiseStartDateTime'])
cruise_stop_date = parser.parse(row['cruiseStopDateTime'])
vessel_obj = None
vessel_event = None
# parse out the vessel name to match its formatting from Vessel CSV
vessel_name_csv = row['ShipName'].strip()
if vessel_name_csv == 'N/A':
Expand Down Expand Up @@ -1120,6 +1122,7 @@ def parse_bulk_files(self):

# Parse Bulk Upload CSV file submission as a separate task
@shared_task(bind=True, soft_time_limit = 3600)
@transaction.atomic
def parse_bulk_file(self, counter):
str_counter = str(counter)
csv_file = cache.get('csv_file_'+str_counter)
Expand Down