anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: digitalfabrik/integreat-cms
Issue: Embedding live content not working

### Describe the Bug
<!-- A clear and concise description of what the bug is. -->
At the moment, embedding live content in pages is not working.

### Steps to Reproduce

1. Go to a region, e.g. "Augsburg"
2. Click on a page, e.g. "Welcome"
3. In the dropdown "Embed live content" select another  region, e.g. "Nürnberg"
4. Nothing happens

### Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->
The next dropdown with the page selection should appear

### Actual Behavior
<!-- A clear and concise description of what actually happened. -->
Nothing appears
### Additional Information
<!-- Add any other context (e.g. logs, screenshots, etc.) about the problem here. -->
The console and the network analysis tab reveal the traceback:

```
FieldError at /ajax/get_pages_list

Cannot resolve keyword 'title' into field.

/home/timo/job/integreat/django/src/cms/views/pages/page_actions.py in get_pages_list_ajax

432.    pages = Page.objects.filter(region__id=region_id).order_by("title")
```

So the problem is very straight forward: the `Page` model does not have a `title` attribute, thus we cannot sort by the title.

Changed files:
src/cms/views/pages/page_actions.py

diff --git a/src/cms/views/pages/page_actions.py b/src/cms/views/pages/page_actions.py
index 914c5c31e..08e8f11a2 100644
--- a/src/cms/views/pages/page_actions.py
+++ b/src/cms/views/pages/page_actions.py
@@ -509,7 +509,7 @@ def get_pages_list_ajax(request):
         page.save()
         return JsonResponse({"nolist": True})
     region_id = decoded_json["region"]
-    pages = Page.objects.filter(region__id=region_id).order_by("title")
+    pages = Page.objects.filter(region__id=region_id)
     result = []
     for page in pages:
         result.append(
@@ -523,6 +523,7 @@ def get_pages_list_ajax(request):
                 ),
             }
         )
+    result = sorted(result, key=lambda k: k["name"])
     return JsonResponse(result, safe=False)
Repository: digitalfabrik/integreat-cms
Issue: Add custom development header to CORS configuration

In #370 I forgot about the custom development header `x-integreat-development` which is used to differentiate actual traffic from dev traffic in the statistics.

Thus, we have to add 
```
from corsheaders.defaults import default_headers

CORS_ALLOW_HEADERS = list(default_headers) + [
    'x-integreat-development',
]
```
to `src/backend/settings.py`.

Changed files:
src/backend/settings.py

diff --git a/src/backend/settings.py b/src/backend/settings.py
index a1f4353a4..852efa48f 100644
--- a/src/backend/settings.py
+++ b/src/backend/settings.py
@@ -9,7 +9,6 @@ https://docs.djangoproject.com/en/2.2/topics/settings/
 For the full list of settings and their values, see
 https://docs.djangoproject.com/en/2.2/ref/settings/
 """
-
 import os
 
 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
@@ -245,3 +244,17 @@ GVZ_API_ENABLED = True
 
 # Allow access to all domains by setting the following variable to TRUE
 CORS_ORIGIN_ALLOW_ALL = True
+
+# Extend default headers with development header to differenciate dev traffic in statistics
+CORS_ALLOW_HEADERS = [
+    'accept',
+    'accept-encoding',
+    'authorization',
+    'content-type',
+    'dnt',
+    'origin',
+    'user-agent',
+    'x-csrftoken',
+    'x-requested-with',
+    'x-integreat-development',
+]