diff --git a/.gitignore b/.gitignore index 1833f77..63cd83d 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,7 @@ privatedev/config/*/history/ privatedev/config/*/obsconfig.p src/core/pyros_django/obsconfig/fixtures/obsconfig.p src/core/pyros_django/obsconfig/fixtures/history/* -src/core/pyros_django/sequences_pickle/ + src/core/guitastro # Token file created by pyros_api.py diff --git a/src/core/pyros_django/routine_manager/views.py b/src/core/pyros_django/routine_manager/views.py index e32c530..4cb051f 100644 --- a/src/core/pyros_django/routine_manager/views.py +++ b/src/core/pyros_django/routine_manager/views.py @@ -1,5 +1,4 @@ from django.core.paginator import Paginator -import pickle from src.pyros_logger import log from pprint import pprint import mimetypes @@ -18,7 +17,6 @@ import ast import os import datetime -from django.forms.models import model_to_dict from src.core.pyros_django.obsconfig.obsconfig_class import OBSConfig from .forms import RequestForm, SequenceForm, AlbumForm, PlanForm, uneditablePlanForm from .validators import check_plan_validity, check_album_validity, check_sequence_validity, check_request_validity @@ -252,23 +250,6 @@ def unsubmit_sequence(request, seq_id): messages.add_message(request,messages.INFO,message) return redirect(action_sequence, seq_id, "view") -def create_sequence_pickle(sequence): - seq_dict = model_to_dict(sequence) - fullseq_dict = { - "sequence":seq_dict, - "albums": {} - } - for album in sequence.albums.all(): - fullseq_dict["albums"][album.name] = {"plans" : []} - for plan in album.plans.all(): - fullseq_dict["albums"][f"{album.name}"]["plans"].append(model_to_dict(instance=plan)) - period = sequence.period - if not os.path.exists("sequences_pickle"): - os.mkdir("./sequences_pickle") - if not os.path.exists(f"sequences_pickle/P{period.id}"): - os.mkdir(f"sequences_pickle/P{period.id}") - seq_pickle_file_name = f"./sequences_pickle/P{period.id}/{sequence.name}.p" - pickle.dump(fullseq_dict,open(seq_pickle_file_name,"wb")) @login_required @level_required("Admin", "Unit-PI", "Observer") @@ -335,7 +316,6 @@ def sequence_validate(request, seq_id): seq.status = Sequence.TOBEPLANNED seq.save() message = "Sequence submitted" - create_sequence_pickle(seq) messages.add_message(request, messages.INFO, message) log.info( f"User {request.user} did action submit sequence {seq} for period {seq.period} ") -- libgit2 0.21.2