internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: ietf-tools/datatracker

Issue:
Don't crash on meetingless invokation of week-view.html
```
NoReverseMatch at /meeting/week-view.html

Reverse for 'agenda' with keyword arguments '{'num': None}' not found. 1 pattern(s) tried: ['meeting/(?:(?P<num>\\d+)/)?agenda(?P<utc>-utc)?(?P<ext>\\.html)?/?$']

Request Method:     GET
Request URL:     https://datatracker.ietf.org/meeting/week-view.html?show=irtf&tz=europe%2Flondon
Django Version:     2.2.28
Exception Type:     NoReverseMatch
Exception Value:    

Reverse for 'agenda' with keyword arguments '{'num': None}' not found. 1 pattern(s) tried: ['meeting/(?:(?P<num>\\d+)/)?agenda(?P<utc>-utc)?(?P<ext>\\.html)?/?$']

Exception Location:     /a/www/ietf-datatracker/9.14.0/env/lib64/python3.9/site-packages/django/urls/resolvers.py in _reverse_with_prefix, line 677
```


Discussion:

Resolving patch:
diff --git a/ietf/meeting/urls.py b/ietf/meeting/urls.py
--- a/ietf/meeting/urls.py
+++ b/ietf/meeting/urls.py
@@ -10,8 +10,7 @@
 class AgendaRedirectView(RedirectView):
     ignore_kwargs = ('owner', 'name')
     def get_redirect_url(self, *args, **kwargs):
-        for kwarg in self.ignore_kwargs:
-            kwargs.pop(kwarg, None)
+        kwargs = {k: v for k, v in kwargs.items() if v is not None and k not in self.ignore_kwargs}
         return super().get_redirect_url(*args, **kwargs)
 
 safe_for_all_meeting_types = [
@@ -78,10 +77,10 @@ def get_redirect_url(self, *args, **kwargs):
     url(r'^agenda/agenda\.ics$', views.agenda_ical),
     url(r'^agenda\.ics$', views.agenda_ical),
     url(r'^agenda.json$', views.agenda_json),
-    url(r'^agenda/week-view(?:.html)?/?$', RedirectView.as_view(pattern_name='agenda', permanent=True)),
+    url(r'^agenda/week-view(?:.html)?/?$', AgendaRedirectView.as_view(pattern_name='agenda', permanent=True)),
     url(r'^floor-plan/?$', views.agenda, name='floor-plan'),
     url(r'^floor-plan/(?P<floor>[-a-z0-9_]+)/?$', RedirectView.as_view(pattern_name='floor-plan', permanent=True)),
-    url(r'^week-view(?:.html)?/?$', RedirectView.as_view(pattern_name='agenda', permanent=True)),
+    url(r'^week-view(?:.html)?/?$', AgendaRedirectView.as_view(pattern_name='agenda', permanent=True)),
     url(r'^materials(?:.html)?/?$', views.materials),
     url(r'^request_minutes/?$', views.request_minutes),
     url(r'^materials/%(document)s((?P<ext>\.[a-z0-9]+)|/)?$' % settings.URL_REGEXPS, views.materials_document),


Test patch:
Repository: ietf-tools/datatracker

Issue:
Remove IESG-related tabs from document about page
### Description

For non-IETF streams. As discussed at tools retreat. Specifically, "IESG evaluation record" and "IESG writeups".

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:

Resolving patch:
diff --git a/ietf/doc/views_doc.py b/ietf/doc/views_doc.py
--- a/ietf/doc/views_doc.py
+++ b/ietf/doc/views_doc.py
@@ -114,13 +114,46 @@ def render_document_top(request, doc, tab, name):
                 rsab_ballot,  
                 None if rsab_ballot else "RSAB Evaluation Ballot has not been created yet"
             ))
-    if doc.type_id in ("draft","conflrev", "statchg"):
-        tabs.append(("IESG Evaluation Record", "ballot", urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=name)), iesg_ballot,  None if iesg_ballot else "IESG Evaluation Ballot has not been created yet"))
-    elif doc.type_id == "charter" and doc.group.type_id == "wg":
-        tabs.append(("IESG Review", "ballot", urlreverse("ietf.doc.views_doc.document_ballot", kwargs=dict(name=name)), iesg_ballot, None if iesg_ballot else "IESG Review Ballot has not been created yet"))
-    
-    if doc.type_id == "draft" or (doc.type_id == "charter" and doc.group.type_id == "wg"):
-        tabs.append(("IESG Writeups", "writeup", urlreverse('ietf.doc.views_doc.document_writeup', kwargs=dict(name=name)), True, None))
+
+    if iesg_ballot or (doc.group and doc.group.type_id == "wg"):
+        if doc.type_id in ("draft", "conflrev", "statchg"):
+            tabs.append(
+                (
+                    "IESG Evaluation Record",
+                    "ballot",
+                    urlreverse(
+                        "ietf.doc.views_doc.document_ballot", kwargs=dict(name=name)
+                    ),
+                    iesg_ballot,
+                    None,
+                )
+            )
+        elif doc.type_id == "charter" and doc.group and doc.group.type_id == "wg":
+            tabs.append(
+                (
+                    "IESG Review",
+                    "ballot",
+                    urlreverse(
+                        "ietf.doc.views_doc.document_ballot", kwargs=dict(name=name)
+                    ),
+                    iesg_ballot,
+                    None,
+                )
+            )
+        if doc.type_id == "draft" or (
+            doc.type_id == "charter" and doc.group and doc.group.type_id == "wg"
+        ):
+            tabs.append(
+                (
+                    "IESG Writeups",
+                    "writeup",
+                    urlreverse(
+                        "ietf.doc.views_doc.document_writeup", kwargs=dict(name=name)
+                    ),
+                    True,
+                    None,
+                )
+            )
 
     tabs.append(("Email expansions","email",urlreverse('ietf.doc.views_doc.document_email', kwargs=dict(name=name)), True, None))
     tabs.append(("History", "history", urlreverse('ietf.doc.views_doc.document_history', kwargs=dict(name=name)), True, None))


Test patch:
Repository: ietf-tools/datatracker

Issue:
Case mismatch for fragment identifiers between menus and page heading anchor
### Describe the issue

The menu item "Groups / Ops and Management" sends you off to https://datatracker.ietf.org/wg/#ops but "#ops" is not recognised on the page because the heading anchor is "#OPS" and so that menu item takes you to the top of the page not the Ops heading.

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:

Resolving patch:
diff --git a/ietf/doc/templatetags/wg_menu.py b/ietf/doc/templatetags/wg_menu.py
--- a/ietf/doc/templatetags/wg_menu.py
+++ b/ietf/doc/templatetags/wg_menu.py
@@ -1,4 +1,4 @@
-# Copyright The IETF Trust 2009-2022, All Rights Reserved
+# Copyright The IETF Trust 2009-2023, All Rights Reserved
 
 # Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
@@ -32,6 +32,8 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+import debug    # pyflakes: ignore
+
 from django import template
 from django.template.loader import render_to_string
 from django.db import models
@@ -68,7 +70,7 @@ def wg_menu(flavor):
             p.short_name = p.short_name[: -len(" Area")]
 
         if p.type_id == "area":
-            p.menu_url = "/wg/#" + p.acronym
+            p.menu_url = "/wg/#" + p.acronym.upper()
         elif p.acronym == "irtf":
             p.menu_url = "/rg/"
         elif p.acronym == "iab":


Test patch:
Repository: ietf-tools/datatracker

Issue:
"Requested session has been scheduled" email lists session time in UTC
### Describe the issue

I know this is related to the other time zone issues, but I wanted to point out one more place where it's causing confusion. The automatic emails after sessions are officially scheduled list the session time in UTC without specifying such. 
Here's the text from one of those emails:

----------

Dear Liz Flynn,

The session(s) that you have requested have been scheduled.
Below is the scheduled session information followed by
the original request. 


   tsvarea Session 1 (1:00 requested)
   **Tuesday, 28 March 2023, Session III 0630-0730**
   Room Name: G302 size: 175
   ---------------------------------------------


iCalendar: https://datatracker.ietf.org/meeting/116/sessions/tsvarea.ics

Request Information:


---------------------------------------------------------
Working Group Name: Transport Area Open Meeting
Area Name: Transport Area
Session Requester: Liz Flynn


Number of Sessions: 1
Length of Session(s): 
Number of Attendees: 60
Conflicts to Avoid: 





---------------------------------------------------------

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:

Resolving patch:
diff --git a/ietf/secr/meetings/views.py b/ietf/secr/meetings/views.py
--- a/ietf/secr/meetings/views.py
+++ b/ietf/secr/meetings/views.py
@@ -1,4 +1,4 @@
-# Copyright The IETF Trust 2007-2019, All Rights Reserved
+# Copyright The IETF Trust 2007-2023, All Rights Reserved
 # -*- coding: utf-8 -*-
 
 import datetime
@@ -129,7 +129,7 @@ def is_combined(session,meeting,schedule=None):
 def send_notifications(meeting, groups, person):
     '''
     Send session scheduled email notifications for each group in groups.  Person is the
-    user who initiated this action, request.uesr.get_profile().
+    user who initiated this action, request.user.get_profile().
     '''
     now = timezone.now()
     for group in groups:
@@ -150,7 +150,7 @@ def send_notifications(meeting, groups, person):
             t = d['timeslot']
             dur = s.requested_duration.seconds/60
             items[i]['duration'] = "%d:%02d" % (dur//60, dur%60)
-            items[i]['period'] = '%s-%s' % (t.time.strftime('%H%M'),(t.time + t.duration).strftime('%H%M'))
+            items[i]['period'] = f"{t.local_start_time().strftime('%H%M')}-{t.local_end_time().strftime('%H%M')} {t.tz()}"
 
         # send email
         first_event = SchedulingEvent.objects.filter(session=sessions[0]).select_related('by').order_by('time', 'id').first()


Test patch:
Repository: ietf-tools/datatracker

Issue:
Dev mode loads assets from static.ietf.org
### Describe the issue

The datatracker container loads assets from `static.ietf.org` instead from the dev environment. That doesn't work when offline, and also means one can't tweak those assets.

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:

Resolving patch:
diff --git a/docker/configs/settings_local.py b/docker/configs/settings_local.py
--- a/docker/configs/settings_local.py
+++ b/docker/configs/settings_local.py
@@ -55,3 +55,5 @@
 SLIDE_STAGING_PATH = 'test/staging/'
 
 DE_GFM_BINARY = '/usr/local/bin/de-gfm'
+
+STATIC_IETF_ORG = "http://localhost:8001"
diff --git a/ietf/doc/models.py b/ietf/doc/models.py
--- a/ietf/doc/models.py
+++ b/ietf/doc/models.py
@@ -627,7 +627,7 @@ def pdfized(self):
             stylesheets.append(finders.find("ietf/css/document_html_txt.css"))
         else:
             text = self.htmlized()
-        stylesheets.append("https://static.ietf.org/fonts/noto-sans-mono/import.css")
+        stylesheets.append(f'{settings.STATIC_IETF_ORG}/fonts/noto-sans-mono/import.css')
 
         cache = caches["pdfized"]
         cache_key = name.split(".")[0]
diff --git a/ietf/settings.py b/ietf/settings.py
--- a/ietf/settings.py
+++ b/ietf/settings.py
@@ -137,7 +137,6 @@
 # Absolute path to the directory static files should be collected to.
 # Example: "/var/www/example.com/static/"
 
-
 SERVE_CDN_PHOTOS = True
 
 SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE = True
@@ -157,6 +156,8 @@
     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
 )
 
+STATIC_IETF_ORG = "https://static.ietf.org"
+
 WSGI_APPLICATION = "ietf.wsgi.application"
 
 AUTHENTICATION_BACKENDS = ( 'ietf.ietfauth.backends.CaseInsensitiveModelBackend', )


Test patch:
Repository: ietf-tools/datatracker

Issue:
Don't crash when a nomcom is partially set up.
Right now, if a nomcom group is created, and the associated NomCom object is not, anyone with a role in the nomcom group cannot use the datatracker - the construction of the menu crashes.

The places that crash need to be protected against this misconfiguration (especially while the configuration of the Group and NomCom objects are done manually).

See also https://github.com/ietf-tools/datatracker/issues/3289


Discussion:
There's a template filter, `active_nomcoms` that currently returns all the groups of type `nomcom` for which a user has a role. The template then looks backwards across the foreign key relationship to find the `NomCom` object. This is backwards - the filter should return `NomCom` instances. This avoids having to deal with the possibility that the `Group` does not have a `NomCom`.

Patch shortly.

Resolving patch:
diff --git a/ietf/group/templatetags/group_filters.py b/ietf/group/templatetags/group_filters.py
--- a/ietf/group/templatetags/group_filters.py
+++ b/ietf/group/templatetags/group_filters.py
@@ -2,7 +2,7 @@
 
 import debug                            # pyflakes:ignore
 
-from ietf.group.models import Group
+from ietf.nomcom.models import NomCom
 
 register = template.Library()
 
@@ -19,14 +19,15 @@ def active_nomcoms(user):
     if not (user and hasattr(user, "is_authenticated") and user.is_authenticated):
         return []
 
-    groups = []
-
-    groups.extend(Group.objects.filter(
-        role__person__user=user,
-        type_id='nomcom',
-        state__slug='active').distinct().select_related("type"))
-
-    return groups
+    return list(
+        NomCom.objects.filter(
+            group__role__person__user=user,
+            group__type_id='nomcom',  # just in case...
+            group__state__slug='active',
+        )
+        .distinct()
+        .order_by("group__acronym")
+    )
 
 @register.inclusion_tag('person/person_link.html')
 def role_person_link(role, **kwargs):


Test patch:
Repository: ietf-tools/datatracker

Issue:
Dev mode PDFization broken
### Describe the issue

The `STATIC_IETF_ORG_INTERNAL` stuff in https://github.com/ietf-tools/datatracker/blob/2bf7e8250c3fc2fcaf9a6223c331a52d1f6d89a4/ietf/doc/models.py#L630 causes a Python error in the dev environment.

CC @NGPixel 

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:
Make sure you're using the latest settings_local.py file, specifically this line:
https://github.com/ietf-tools/datatracker/blob/main/docker/configs/settings_local.py#L60
I am
This is from within the docker image:
```
curl http://localhost:80/fonts/noto-sans-mono/import.css
curl: (7) Failed to connect to localhost port 80: Connection refused
```
I found the issue. I'm working on a fix.

Resolving patch:
diff --git a/docker/configs/settings_local.py b/docker/configs/settings_local.py
--- a/docker/configs/settings_local.py
+++ b/docker/configs/settings_local.py
@@ -57,4 +57,4 @@
 DE_GFM_BINARY = '/usr/local/bin/de-gfm'
 
 STATIC_IETF_ORG = "/_static"
-STATIC_IETF_ORG_INTERNAL = "http://localhost:80"
+STATIC_IETF_ORG_INTERNAL = "http://static"


Test patch:
Repository: ietf-tools/datatracker

Issue:
chore: Replace deprecated bootstrap features with alternatives
### Description

Throughout the code. As suggested by @NGPixel.

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:

Resolving patch:
diff --git a/ietf/ietfauth/widgets.py b/ietf/ietfauth/widgets.py
--- a/ietf/ietfauth/widgets.py
+++ b/ietf/ietfauth/widgets.py
@@ -41,7 +41,7 @@ def render(self, name, value, attrs=None, renderer=None):
             <div class="progress" style="margin-bottom: 10px;">
                 <div class="progress-bar progress-bar-warning password_strength_bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="5" style="width: 0%%"></div>
             </div>
-            <p class="text-muted password_strength_info hidden">
+            <p class="text-body-secondary password_strength_info hidden">
                 <span class="label label-danger">
                     %s
                 </span>
@@ -89,7 +89,7 @@ def render(self, name, value, attrs=None, renderer=None):
             
         confirmation_markup = """
         <div style="margin-top: 10px;" class="hidden password_strength_info">
-            <p class="text-muted">
+            <p class="text-body-secondary">
                 <span class="label label-danger">
                     %s
                 </span>


Test patch:
Repository: ietf-tools/datatracker

Issue:
add  xml reference as button on document page
### Description

I always struggle to get the proper `<reference>` for a draft that I'm referencing in my own draft. I know it is available like in bib.ietf.org (and maybe other places), but I always go to the datatracker for that draft (to know its status, get the right version, ...). It would be very valuable and probably not that lot of work (given already implemented the bibtex button) to have in datatracker/doc/draft-... a new button in the "Formats" line to provide such bibxml info of that draft. 

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:

Resolving patch:
diff --git a/ietf/doc/utils.py b/ietf/doc/utils.py
--- a/ietf/doc/utils.py
+++ b/ietf/doc/utils.py
@@ -1038,6 +1038,7 @@ def build_file_urls(doc: Union[Document, DocHistory]):
             file_urls.append(("htmlized", urlreverse('ietf.doc.views_doc.document_html', kwargs=dict(name=doc.name, rev=doc.rev))))
             file_urls.append(("pdfized", urlreverse('ietf.doc.views_doc.document_pdfized', kwargs=dict(name=doc.name, rev=doc.rev))))
         file_urls.append(("bibtex", urlreverse('ietf.doc.views_doc.document_bibtex',kwargs=dict(name=doc.name,rev=doc.rev))))
+        file_urls.append(("bibxml", urlreverse('ietf.doc.views_doc.document_bibxml',kwargs=dict(name=doc.name,rev=doc.rev))))
     else:
         # As of 2022-12-14, there are 1463 Document and 3136 DocHistory records with type='draft' and rev=''.
         # All of these are in the rfc state and are covered by the above cases.


Test patch:
diff --git a/ietf/doc/tests_utils.py b/ietf/doc/tests_utils.py
--- a/ietf/doc/tests_utils.py
+++ b/ietf/doc/tests_utils.py
@@ -308,7 +308,7 @@ def test_build_file_urls(self, mocked):
             build_file_urls(WgDraftFactory(rev=''))
 
         urls, types = build_file_urls(WgDraftFactory(rev='23'))
-        self.assertEqual(['xml', 'bibtex'], [t for t, _ in urls])
+        self.assertEqual(['xml', 'bibtex', 'bibxml'], [t for t, _ in urls])
         self.assertEqual(types, ['xml'])
 
         urls, types = build_file_urls(WgRfcFactory(rev=''))
Repository: ietf-tools/datatracker

Issue:
Add "generate email" to action on nominees page
### Description

It can be useful to search through the nominees, pick a subset, and then generate an email list of those picked. For example, find all those who have submitted questionnaires and then click on those who have not been interviewed, generate an email list, so that you can cut/paste it into a mail message to remind them to sign up for an interview time.

Perhaps the list should have each entry end with a semicolon to make it easier to directly cut and paste it.

### Code of Conduct

- [X] I agree to follow the [IETF's Code of Conduct](https://github.com/ietf-tools/.github/blob/main/CODE_OF_CONDUCT.md)


Discussion:
And the block of addresses should be wrapped in `<pre>...</pre>` tags.
As in #4894, I'm not sure about optimizing for cut-paste. Different email clients expect different things if you're going to paste a list of addresses into them. Maybe providing a mailto: link with the selected addresses populated would be better?
I think a downloaded list, *without mailto:* is probably better.  mailto doesn't easily support a single mail to multiple people.  I often wanted to send "hey folks, if you're on the CC list you didn't complete your questionnaire"  That's the workflow.
Where have you seen trouble with mailto supporting multiple mail recipients? I've built those all the time. You can even tell it to put things in cc.
"Never mind"  Brain f--t.

Resolving patch:
diff --git a/ietf/nomcom/views.py b/ietf/nomcom/views.py
--- a/ietf/nomcom/views.py
+++ b/ietf/nomcom/views.py
@@ -190,6 +190,7 @@ def private_index(request, year):
     nomcom = get_nomcom_by_year(year)
     all_nominee_positions = NomineePosition.objects.get_by_nomcom(nomcom).not_duplicated()
     is_chair = nomcom.group.has_role(request.user, "chair")
+    mailto = None
     if is_chair and request.method == 'POST':
         if nomcom.group.state_id != 'active':
             messages.warning(request, "This nomcom is not active. Request administrative assistance if Nominee state needs to change.")
@@ -207,6 +208,8 @@ def private_index(request, year):
                 elif action == "set_as_pending":
                     nominations.update(state='pending')
                     messages.success(request,'The selected nominations have been set as pending')
+                elif action == 'email':
+                    mailto = ','.join([np.nominee.email.email_address() for np in nominations])
             else:
                 messages.warning(request, "Please, select some nominations to work with")
 
@@ -278,6 +281,7 @@ def private_index(request, year):
                                'selected_position': selected_position and int(selected_position) or None,
                                'selected': 'index',
                                'is_chair': is_chair,
+                               'mailto': mailto,
                               })
 
 


Test patch: