Merge remote-tracking branch 'origin/main' into feat/postgres

This commit is contained in:
Robert Sparks 2023-01-26 10:37:50 -06:00
commit c04feb5765
No known key found for this signature in database
GPG key ID: 6E2A6A5775F91318
11 changed files with 41 additions and 20 deletions

View file

@ -63,6 +63,7 @@ jobs:
platforms: ${{ matrix.platform }}
push: true
tags: ghcr.io/ietf-tools/datatracker-db:latest-${{ matrix.docker }}
provenance: false
combine-mariadb:
name: Create MariaDB Docker Manifests
@ -184,3 +185,4 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/ietf-tools/datatracker-db-pg:latest,ghcr.io/ietf-tools/datatracker-db-pg:nightly-${{ steps.date.outputs.date }}
provenance: false

View file

@ -34,7 +34,7 @@ from ietf.iesg.models import TelechatDate
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.mail import outbox, empty_outbox, get_payload_text
from ietf.utils.test_utils import TestCase
from ietf.utils.timezone import date_today, datetime_from_date
from ietf.utils.timezone import date_today, datetime_from_date, DEADLINE_TZINFO
class ChangeStateTests(TestCase):
@ -1749,8 +1749,11 @@ class ChangeStreamStateTests(TestCase):
self.assertEqual(draft.docevent_set.count() - events_before, 2)
reminder = DocReminder.objects.filter(event__doc=draft, type="stream-s")
self.assertEqual(len(reminder), 1)
due = timezone.now() + datetime.timedelta(weeks=10)
self.assertTrue(due - datetime.timedelta(days=1) <= reminder[0].due <= due + datetime.timedelta(days=1))
due = timezone.now().astimezone(DEADLINE_TZINFO) + datetime.timedelta(weeks=10)
self.assertTrue(
due - datetime.timedelta(days=1) <= reminder[0].due <= due + datetime.timedelta(days=1),
f'Due date {reminder[0].due} should be {due} +/- 1 day'
)
self.assertEqual(len(outbox), 1)
self.assertTrue("state changed" in outbox[0]["Subject"].lower())
self.assertTrue("mars-chairs@ietf.org" in outbox[0].as_string())
@ -1794,8 +1797,11 @@ class ChangeStreamStateTests(TestCase):
self.assertEqual(draft.docevent_set.count() - events_before, 2)
reminder = DocReminder.objects.filter(event__doc=draft, type="stream-s")
self.assertEqual(len(reminder), 1)
due = timezone.now() + datetime.timedelta(weeks=10)
self.assertTrue(due - datetime.timedelta(days=1) <= reminder[0].due <= due + datetime.timedelta(days=1))
due = timezone.now().astimezone(DEADLINE_TZINFO) + datetime.timedelta(weeks=10)
self.assertTrue(
due - datetime.timedelta(days=1) <= reminder[0].due <= due + datetime.timedelta(days=1),
f'Due date {reminder[0].due} should be {due} +/- 1 day'
)
self.assertEqual(len(outbox), 1)
self.assertTrue("state changed" in outbox[0]["Subject"].lower())
self.assertTrue("mars-chairs@ietf.org" in outbox[0].as_string())

View file

@ -390,22 +390,22 @@ def document_main(request, name, rev=None, document_html=False):
if doc.get_state_slug() == "expired" and has_role(request.user, ("Secretariat",)) and not snapshot:
actions.append(("Resurrect", urlreverse('ietf.doc.views_draft.resurrect', kwargs=dict(name=doc.name))))
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and not doc.ballot_open('irsg-approve') and can_edit_stream_info):
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and not doc.ballot_open('irsg-approve') and has_role(request.user, ("Secretariat", "IRTF Chair"))):
label = "Issue IRSG Ballot"
actions.append((label, urlreverse('ietf.doc.views_ballot.issue_irsg_ballot', kwargs=dict(name=doc.name))))
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and doc.ballot_open('irsg-approve') and can_edit_stream_info):
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("irtf",) and not snapshot and doc.ballot_open('irsg-approve') and has_role(request.user, ("Secretariat", "IRTF Chair"))):
label = "Close IRSG Ballot"
actions.append((label, urlreverse('ietf.doc.views_ballot.close_irsg_ballot', kwargs=dict(name=doc.name))))
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("ise", "irtf")
and can_edit_stream_info and not conflict_reviews and not snapshot):
and has_role(request.user, ("Secretariat", "IRTF Chair")) and not conflict_reviews and not snapshot):
label = "Begin IETF Conflict Review"
if not doc.intended_std_level:
label += " (note that intended status is not set)"
actions.append((label, urlreverse('ietf.doc.views_conflict_review.start_review', kwargs=dict(name=doc.name))))
if (doc.get_state_slug() not in ["rfc", "expired"] and doc.stream_id in ("iab", "ise", "irtf")
and can_edit_stream_info and not snapshot):
and (has_role(request.user, ("Secretariat", "IRTF Chair")) if doc.stream_id=="irtf" else can_edit_stream_info) and not snapshot):
if doc.get_state_slug('draft-stream-%s' % doc.stream_id) not in ('rfc-edit', 'pub', 'dead'):
label = "Request Publication"
if not doc.intended_std_level:

View file

@ -1292,7 +1292,10 @@ def request_publication(request, name):
doc = get_object_or_404(Document, type="draft", name=name, stream__in=("iab", "ise", "irtf"))
if not is_authorized_in_doc_stream(request.user, doc):
if doc.stream_id == "irtf":
if not has_role(request.user, ("Secretariat", "IRTF Chair")):
permission_denied(request, "You do not have the necessary permissions to view this page.")
elif not is_authorized_in_doc_stream(request.user, doc):
permission_denied(request, "You do not have the necessary permissions to view this page.")
consensus_event = doc.latest_event(ConsensusDocEvent, type="changed_consensus")

View file

@ -17,7 +17,7 @@ from ietf.doc.models import Document, LastCallDocEvent, ConsensusDocEvent
from ietf.doc.utils_search import fill_in_telechat_date
from ietf.iesg.models import TelechatDate, TelechatAgendaItem
from ietf.review.utils import review_assignments_to_list_for_docs
from ietf.utils.timezone import date_today
from ietf.utils.timezone import date_today, make_aware
def get_agenda_date(date=None):
if not date:
@ -26,8 +26,9 @@ def get_agenda_date(date=None):
except IndexError:
return date_today()
else:
parsed_date = make_aware(datetime.datetime.strptime(date, "%Y-%m-%d"), settings.TIME_ZONE).date()
try:
return TelechatDate.objects.active().get(date=datetime.datetime.strptime(date, "%Y-%m-%d").date()).date
return TelechatDate.objects.active().get(date=parsed_date).date
except (ValueError, TelechatDate.DoesNotExist):
raise Http404

View file

@ -49,13 +49,20 @@ document.addEventListener("DOMContentLoaded", function (event) {
// activate pref buttons selected by pref cookies or localStorage
const in_localStorage = ["deftab", "reflinks"];
const btn_pref = {
"sidebar": "on",
"deftab": "docinfo",
"htmlconf": "html",
"pagedeps": "reference",
"reflinks": "refsection"
};
document.querySelectorAll("#pref-tab-pane .btn-check")
.forEach(btn => {
const id = btn.id.replace("-radio", "");
const val = in_localStorage.includes(btn.name) ?
localStorage.getItem(btn.name) : cookies.get(btn.name);
if (val == id) {
if (val === id || (val === null && btn_pref[btn.name] === id)) {
btn.checked = true;
}

View file

@ -13,5 +13,5 @@
</front>
<seriesInfo name="Internet-Draft" value="{{name}}-{{doc.rev}}" />
{% if doi %}<seriesInfo name="DOI" value="{{doi}}" />
{% endif %}<format type="TXT" target="https://www.ietf.org/archive/id/{{name}}-{{doc.rev}}.txt" />
{% endif %}
</reference>

View file

@ -167,7 +167,7 @@
</span>
</p>
{% if request.COOKIES.htmlconf != 'html' and html %}
{% if request.COOKIES.htmlconf and request.COOKIES.htmlconf != 'html' and html %}
<div class="alert alert-info small">
You are viewing the legacy <code><a class="text-decoration-none text-reset" href="https://github.com/ietf-tools/rfc2html">rfc2html</a></code>
rendering of this document. Change the

View file

@ -36,6 +36,7 @@
<th scope="col" data-sort="group">Group</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="count">Length</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="num">Size</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="num">Purpose</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="requester">Requester</th>
<th scope="col" class="d-none d-lg-table-cell" data-sort="ad">AD</th>
<th scope="col" data-sort="constraints">Constraints</th>
@ -76,6 +77,7 @@
{% if session.requested_duration %}{{ session.requested_duration|stringformat:"s"|slice:"0:4" }}{% endif %}
</td>
<td class="d-none d-lg-table-cell">{{ session.attendees|default:"" }}</td>
<td class="d-none d-lg-table-cell">{% if session.purpose_id != "regular" %}{{session.purpose}}{% endif %}</td>
<td class="d-none d-lg-table-cell">{% person_link session.requested_by_person with_email=False %}</td>
<td class="d-none d-lg-table-cell">
{% if session.group.ad_role %}

View file

@ -20,11 +20,11 @@ import debug # pyflakes:ignore
from .texescape import init as texescape_init, tex_escape_map
tlds_sorted = sorted(tlds.tld_set, key=len, reverse=True)
protocols = copy.copy(bleach.sanitizer.ALLOWED_PROTOCOLS)
protocols.append("ftp") # we still have some ftp links
protocols.append("xmpp") # we still have some xmpp links
protocols = set(bleach.sanitizer.ALLOWED_PROTOCOLS)
protocols.add("ftp") # we still have some ftp links
protocols.add("xmpp") # we still have some xmpp links
tags = set(copy.copy(bleach.sanitizer.ALLOWED_TAGS)).union(
tags = set(bleach.sanitizer.ALLOWED_TAGS).union(
{
# fmt: off
'a', 'abbr', 'acronym', 'address', 'b', 'big',

View file

@ -4,7 +4,7 @@ setuptools>=51.1.0 # Require this first, to prevent later errors
argon2-cffi>=21.3.0 # For the Argon2 password hasher option
beautifulsoup4>=4.11.1 # Only used in tests
bibtexparser>=1.2.0 # Only used in tests
bleach>=5.0.0
bleach>=6
celery>=5.2.6
coverage>=4.5.4,<5.0 # Coverage 5.x moves from a json database to SQLite. Moving to 5.x will require substantial rewrites in ietf.utils.test_runner and ietf.release.views
decorator>=5.1.1