Skip to content

Commit

Permalink
Fetch and pass User to record_block()
Browse files Browse the repository at this point in the history
  • Loading branch information
talister committed Sep 22, 2022
1 parent b6f9dae commit 5e56478
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions neoexchange/core/management/commands/robo_scheduler.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
NEO exchange: NEO observing portal for Las Cumbres Observatory
Copyright (C) 2017-2021 LCO
Copyright (C) 2017-2022 LCO
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -16,6 +16,7 @@
from datetime import datetime, timedelta
from math import degrees

from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError

from core.models import Body, Block
Expand Down Expand Up @@ -133,7 +134,8 @@ def schedule_target_list(bodies_list, form_details, username):

print("%s@%s for %s->%s" % (target.current_name(), data['site_code'], data['start_time'], data['end_time']))
tracking_num, sched_params = schedule_submit(data, target, username)
block_resp = record_block(tracking_num, sched_params, data, target)
user = User.objects.get(username=username)
block_resp = record_block(tracking_num, sched_params, data, target, user)

if block_resp:
num_scheduled += 1
Expand All @@ -149,7 +151,7 @@ def add_arguments(self, parser):
faint_default = 22.0
spd_default = 95.0
not_seen_default = 2.5
proposal_default = 'LCO2021B-002'
proposal_default = 'LCO2022B-006'
speed_limit_default = 5.0
parser.add_argument('--date', default=datetime.utcnow(), help='Date to schedule for (YYYYMMDD-HH)')
parser.add_argument('--user', default='tlister@lcogt.net', help="Username to schedule as e.g. 'tlister@lcogt.net'")
Expand Down

0 comments on commit 5e56478

Please sign in to comment.