Skip to content

Commit

Permalink
Small bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
timbeccue committed Dec 4, 2024
1 parent 16ebcb5 commit 4cd0eed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions import_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def create_ptr_resources(self):

def _translate_to_calendar(self):
# we need the project_id, so do the project translation if it doesn't exist
if not self.project:
if not hasattr(self, 'project'):
self._translate_to_project()

observation = self.observation # just for readability
Expand Down Expand Up @@ -153,14 +153,14 @@ def truncate_microseconds(date_str):
self.project = project

def create_calendar(self):
if not self.calendar_event:
if not hasattr(self, 'calendar_event'):
self._translate_to_calendar()
response = create_calendar_event(self.calendar_event) # this is an imported function
print("Created new calendar event")
return response

def create_project(self):
if not self.project:
if not hasattr(self, 'project'):
self._translate_to_project()
url = get_projects_url('new-project')
response = requests.post(url, json.dumps(self.project))
Expand Down

0 comments on commit 4cd0eed

Please sign in to comment.