fix: Add history entry when approving the slides. (#6588)
* Added history entry when approving the slides. Also changed os.rename to shutils.move as the submissions and proceedings are on the separate filesystems on the docker image, and this same thing might happen in the real environment in the future. * Add migrations for the docevents type.
This commit is contained in:
parent
b5ee9ec9ab
commit
f8a06f663e
91
ietf/doc/migrations/0008_alter_docevent_type.py
Normal file
91
ietf/doc/migrations/0008_alter_docevent_type.py
Normal file
|
@ -0,0 +1,91 @@
|
|||
# Generated by Django 4.2.7 on 2023-11-04 13:02
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("doc", "0007_alter_docevent_type"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="docevent",
|
||||
name="type",
|
||||
field=models.CharField(
|
||||
choices=[
|
||||
("new_revision", "Added new revision"),
|
||||
("new_submission", "Uploaded new revision"),
|
||||
("changed_document", "Changed document metadata"),
|
||||
("added_comment", "Added comment"),
|
||||
("added_message", "Added message"),
|
||||
("edited_authors", "Edited the documents author list"),
|
||||
("deleted", "Deleted document"),
|
||||
("changed_state", "Changed state"),
|
||||
("changed_stream", "Changed document stream"),
|
||||
("expired_document", "Expired document"),
|
||||
("extended_expiry", "Extended expiry of document"),
|
||||
("requested_resurrect", "Requested resurrect"),
|
||||
("completed_resurrect", "Completed resurrect"),
|
||||
("changed_consensus", "Changed consensus"),
|
||||
("published_rfc", "Published RFC"),
|
||||
(
|
||||
"added_suggested_replaces",
|
||||
"Added suggested replacement relationships",
|
||||
),
|
||||
(
|
||||
"reviewed_suggested_replaces",
|
||||
"Reviewed suggested replacement relationships",
|
||||
),
|
||||
("changed_action_holders", "Changed action holders for document"),
|
||||
("changed_group", "Changed group"),
|
||||
("changed_protocol_writeup", "Changed protocol writeup"),
|
||||
("changed_charter_milestone", "Changed charter milestone"),
|
||||
("initial_review", "Set initial review time"),
|
||||
("changed_review_announcement", "Changed WG Review text"),
|
||||
("changed_action_announcement", "Changed WG Action text"),
|
||||
("started_iesg_process", "Started IESG process on document"),
|
||||
("created_ballot", "Created ballot"),
|
||||
("closed_ballot", "Closed ballot"),
|
||||
("sent_ballot_announcement", "Sent ballot announcement"),
|
||||
("changed_ballot_position", "Changed ballot position"),
|
||||
("changed_ballot_approval_text", "Changed ballot approval text"),
|
||||
("changed_ballot_writeup_text", "Changed ballot writeup text"),
|
||||
("changed_rfc_editor_note_text", "Changed RFC Editor Note text"),
|
||||
("changed_last_call_text", "Changed last call text"),
|
||||
("requested_last_call", "Requested last call"),
|
||||
("sent_last_call", "Sent last call"),
|
||||
("scheduled_for_telechat", "Scheduled for telechat"),
|
||||
("iesg_approved", "IESG approved document (no problem)"),
|
||||
("iesg_disapproved", "IESG disapproved document (do not publish)"),
|
||||
("approved_in_minute", "Approved in minute"),
|
||||
("iana_review", "IANA review comment"),
|
||||
("rfc_in_iana_registry", "RFC is in IANA registry"),
|
||||
(
|
||||
"rfc_editor_received_announcement",
|
||||
"Announcement was received by RFC Editor",
|
||||
),
|
||||
("requested_publication", "Publication at RFC Editor requested"),
|
||||
(
|
||||
"sync_from_rfc_editor",
|
||||
"Received updated information from RFC Editor",
|
||||
),
|
||||
("requested_review", "Requested review"),
|
||||
("assigned_review_request", "Assigned review request"),
|
||||
("closed_review_request", "Closed review request"),
|
||||
("closed_review_assignment", "Closed review assignment"),
|
||||
("downref_approved", "Downref approved"),
|
||||
("posted_related_ipr", "Posted related IPR"),
|
||||
("removed_related_ipr", "Removed related IPR"),
|
||||
(
|
||||
"removed_objfalse_related_ipr",
|
||||
"Removed Objectively False related IPR",
|
||||
),
|
||||
("changed_editors", "Changed BOF Request editors"),
|
||||
("published_statement", "Published statement"),
|
||||
("approved_slides", "Slides approved"),
|
||||
],
|
||||
max_length=50,
|
||||
),
|
||||
),
|
||||
]
|
|
@ -1315,6 +1315,9 @@ EVENT_TYPES = [
|
|||
|
||||
# Statement events
|
||||
("published_statement", "Published statement"),
|
||||
|
||||
# Slide events
|
||||
("approved_slides", "Slides approved"),
|
||||
|
||||
]
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import pytz
|
|||
import re
|
||||
import tarfile
|
||||
import tempfile
|
||||
import shutil
|
||||
|
||||
from calendar import timegm
|
||||
from collections import OrderedDict, Counter, deque, defaultdict, namedtuple
|
||||
|
@ -4555,8 +4556,10 @@ def approve_proposed_slides(request, slidesubmission_id, num):
|
|||
path = os.path.join(submission.session.meeting.get_materials_path(),'slides')
|
||||
if not os.path.exists(path):
|
||||
os.makedirs(path)
|
||||
os.rename(submission.staged_filepath(), os.path.join(path, target_filename))
|
||||
shutil.move(submission.staged_filepath(), os.path.join(path, target_filename))
|
||||
post_process(doc)
|
||||
DocEvent.objects.create(type="approved_slides", doc=doc, rev=doc.rev, by=request.user.person, desc="Slides approved")
|
||||
|
||||
acronym = submission.session.group.acronym
|
||||
submission.status = SlideSubmissionStatusName.objects.get(slug='approved')
|
||||
submission.doc = doc
|
||||
|
|
Loading…
Reference in a new issue