We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Feedback link on left hand side is broken
There are a few issues with the Feedback "tab" on the left hand side:
 * The styling is not rendering properly in FF 54 (Linux).  I see no background for to the text that comes up, instead it dims the page and I see the text overlayed over the page text.
 * The text indicates I am being redirected, but the redirect does not seem to execute.
 * The redirect link goes to [getsatisfaction.com](http://retired.getsatisfaction.com/) which is not active.  It should probably go to this issue tracker.

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mygpo/users/settings.py`
Content:
```
1 from collections import namedtuple
2 
3 
4 WellKnownSetting = namedtuple('WellKnownSetting', 'name default')
5 
6 ## Well-known settings
7 # this should be documented at
8 # http://wiki.gpodder.org/wiki/Web_Services/API_2/Settings#Known_Settings
9 
10 # Flag to allow storing of user-agents
11 STORE_UA = WellKnownSetting('store_user_agent', True)
12 
13 # Flag to mark a subscription as public
14 PUBLIC_SUB_PODCAST = WellKnownSetting('public_subscription', True)
15 
16 # Default public-flag value (stored in the podcast)
17 PUBLIC_SUB_USER = WellKnownSetting('public_subscriptions', True)
18 
19 # Flattr authentication token, empty if not logged in
20 FLATTR_TOKEN = WellKnownSetting('flattr_token', '')
21 
22 # enable auto-flattring
23 FLATTR_AUTO = WellKnownSetting('auto_flattr', False)
24 
25 # auto-flattr mygpo
26 FLATTR_MYGPO = WellKnownSetting('flattr_mygpo', False)
27 
28 # username for flattr buttons for own content
29 FLATTR_USERNAME = WellKnownSetting('flattr_username', '')
30 
31 # Flag to mark an episode as favorite
32 FAV_FLAG = WellKnownSetting('is_favorite', False)
33
```

Path: `mygpo/api/advanced/updates.py`
Content:
```
1 from itertools import chain
2 from datetime import datetime
3 
4 from django.http import HttpResponseBadRequest, HttpResponseNotFound
5 from django.contrib.sites.requests import RequestSite
6 from django.views.decorators.csrf import csrf_exempt
7 from django.views.decorators.cache import never_cache
8 from django.utils.decorators import method_decorator
9 from django.views import View
10 
11 from mygpo.podcasts.models import Episode
12 from mygpo.api.httpresponse import JsonResponse
13 from mygpo.api.advanced import episode_action_json
14 from mygpo.api.advanced.directory import episode_data, podcast_data
15 from mygpo.utils import parse_bool, get_timestamp
16 from mygpo.subscriptions import get_subscription_history, subscription_diff
17 from mygpo.users.models import Client
18 from mygpo.episodestates.models import EpisodeState
19 from mygpo.users.subscriptions import subscription_changes, podcasts_for_states
20 from mygpo.api.basic_auth import require_valid_user, check_username
21 from mygpo.decorators import cors_origin
22 
23 from collections import namedtuple
24 EpisodeStatus = namedtuple('EpisodeStatus', 'episode status action')
25 
26 import logging
27 logger = logging.getLogger(__name__)
28 
29 
30 class DeviceUpdates(View):
31     """ returns various updates for a device
32 
33     http://wiki.gpodder.org/wiki/Web_Services/API_2/Devices#Get_Updates """
34 
35     @method_decorator(csrf_exempt)
36     @method_decorator(require_valid_user)
37     @method_decorator(check_username)
38     @method_decorator(never_cache)
39     @method_decorator(cors_origin())
40     def get(self, request, username, device_uid):
41 
42         now = datetime.utcnow()
43         now_ = get_timestamp(now)
44 
45         user = request.user
46 
47         try:
48             device = user.client_set.get(uid=device_uid)
49         except Client.DoesNotExist as e:
50             return HttpResponseNotFound(str(e))
51 
52         try:
53             since = self.get_since(request)
54         except ValueError as e:
55             return HttpResponseBadRequest(str(e))
56 
57         include_actions = parse_bool(request.GET.get('include_actions', False))
58 
59         domain = RequestSite(request).domain
60 
61         add, rem, subscriptions = self.get_subscription_changes(user, device,
62                                                                 since, now,
63                                                                 domain)
64         updates = self.get_episode_changes(user, subscriptions, domain,
65                                            include_actions, since)
66 
67         return JsonResponse({
68             'add': add,
69             'rem': rem,
70             'updates': updates,
71             'timestamp': get_timestamp(now),
72         })
73 
74 
75     def get_subscription_changes(self, user, device, since, now, domain):
76         """ gets new, removed and current subscriptions """
77 
78         history = get_subscription_history(user, device, since, now)
79         add, rem = subscription_diff(history)
80 
81         subscriptions = device.get_subscribed_podcasts()
82 
83         add = [podcast_data(p, domain) for p in add]
84         rem = [p.url for p in rem]
85 
86         return add, rem, subscriptions
87 
88 
89     def get_episode_changes(self, user, subscriptions, domain, include_actions, since):
90         devices = {dev.id.hex: dev.uid for dev in user.client_set.all()}
91 
92         # index subscribed podcasts by their Id for fast access
93         podcasts = {p.get_id(): p for p in subscriptions}
94 
95         episode_updates = self.get_episode_updates(user, subscriptions, since)
96 
97         return [self.get_episode_data(status, podcasts, domain,
98                 include_actions, user, devices) for status in episode_updates]
99 
100 
101     def get_episode_updates(self, user, subscribed_podcasts, since,
102             max_per_podcast=5):
103         """ Returns the episode updates since the timestamp """
104 
105         episodes = []
106         for podcast in subscribed_podcasts:
107             eps = Episode.objects.filter(podcast=podcast,
108                                          released__gt=since)\
109                                  .order_by('-order', '-released')
110             episodes.extend(eps[:max_per_podcast])
111 
112         states = EpisodeState.dict_for_user(user, episodes)
113 
114         for episode in episodes:
115             yield EpisodeStatus(episode, states.get(episode.id, 'new'), None)
116 
117 
118     def get_episode_data(self, episode_status, podcasts, domain, include_actions, user, devices):
119         """ Get episode data for an episode status object """
120 
121         # TODO: shouldn't the podcast_id be in the episode status?
122         podcast_id = episode_status.episode.podcast
123         podcast = podcasts.get(podcast_id, None)
124         t = episode_data(episode_status.episode, domain, podcast)
125         t['status'] = episode_status.status
126 
127         # include latest action (bug 1419)
128         # TODO
129         if include_actions and episode_status.action:
130             t['action'] = episode_action_json(episode_status.action, user)
131 
132         return t
133 
134     def get_since(self, request):
135         """ parses the "since" parameter """
136         since_ = request.GET.get('since', None)
137         if since_ is None:
138             raise ValueError('parameter since missing')
139         try:
140             return datetime.fromtimestamp(float(since_))
141         except ValueError as e:
142             raise ValueError("'since' is not a valid timestamp: %s" % str(e))
143
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mygpo/api/advanced/updates.py b/mygpo/api/advanced/updates.py
--- a/mygpo/api/advanced/updates.py
+++ b/mygpo/api/advanced/updates.py
@@ -30,7 +30,7 @@
 class DeviceUpdates(View):
     """ returns various updates for a device
 
-    http://wiki.gpodder.org/wiki/Web_Services/API_2/Devices#Get_Updates """
+    https://gpoddernet.readthedocs.io/en/latest/api//Devices#Get_Updates """
 
     @method_decorator(csrf_exempt)
     @method_decorator(require_valid_user)
diff --git a/mygpo/users/settings.py b/mygpo/users/settings.py
--- a/mygpo/users/settings.py
+++ b/mygpo/users/settings.py
@@ -5,7 +5,7 @@
 
 ## Well-known settings
 # this should be documented at
-# http://wiki.gpodder.org/wiki/Web_Services/API_2/Settings#Known_Settings
+# https://gpoddernet.readthedocs.io/en/latest/api//Settings#Known_Settings
 
 # Flag to allow storing of user-agents
 STORE_UA = WellKnownSetting('store_user_agent', True)

{"golden_diff": "diff --git a/mygpo/api/advanced/updates.py b/mygpo/api/advanced/updates.py\n--- a/mygpo/api/advanced/updates.py\n+++ b/mygpo/api/advanced/updates.py\n@@ -30,7 +30,7 @@\n class DeviceUpdates(View):\n     \"\"\" returns various updates for a device\n \n-    http://wiki.gpodder.org/wiki/Web_Services/API_2/Devices#Get_Updates \"\"\"\n+    https://gpoddernet.readthedocs.io/en/latest/api//Devices#Get_Updates \"\"\"\n \n     @method_decorator(csrf_exempt)\n     @method_decorator(require_valid_user)\ndiff --git a/mygpo/users/settings.py b/mygpo/users/settings.py\n--- a/mygpo/users/settings.py\n+++ b/mygpo/users/settings.py\n@@ -5,7 +5,7 @@\n \n ## Well-known settings\n # this should be documented at\n-# http://wiki.gpodder.org/wiki/Web_Services/API_2/Settings#Known_Settings\n+# https://gpoddernet.readthedocs.io/en/latest/api//Settings#Known_Settings\n \n # Flag to allow storing of user-agents\n STORE_UA = WellKnownSetting('store_user_agent', True)\n", "issue": "Feedback link on left hand side is broken\nThere are a few issues with the Feedback \"tab\" on the left hand side:\r\n * The styling is not rendering properly in FF 54 (Linux).  I see no background for to the text that comes up, instead it dims the page and I see the text overlayed over the page text.\r\n * The text indicates I am being redirected, but the redirect does not seem to execute.\r\n * The redirect link goes to [getsatisfaction.com](http://retired.getsatisfaction.com/) which is not active.  It should probably go to this issue tracker.\n", "before_files": [{"content": "from collections import namedtuple\n\n\nWellKnownSetting = namedtuple('WellKnownSetting', 'name default')\n\n## Well-known settings\n# this should be documented at\n# http://wiki.gpodder.org/wiki/Web_Services/API_2/Settings#Known_Settings\n\n# Flag to allow storing of user-agents\nSTORE_UA = WellKnownSetting('store_user_agent', True)\n\n# Flag to mark a subscription as public\nPUBLIC_SUB_PODCAST = WellKnownSetting('public_subscription', True)\n\n# Default public-flag value (stored in the podcast)\nPUBLIC_SUB_USER = WellKnownSetting('public_subscriptions', True)\n\n# Flattr authentication token, empty if not logged in\nFLATTR_TOKEN = WellKnownSetting('flattr_token', '')\n\n# enable auto-flattring\nFLATTR_AUTO = WellKnownSetting('auto_flattr', False)\n\n# auto-flattr mygpo\nFLATTR_MYGPO = WellKnownSetting('flattr_mygpo', False)\n\n# username for flattr buttons for own content\nFLATTR_USERNAME = WellKnownSetting('flattr_username', '')\n\n# Flag to mark an episode as favorite\nFAV_FLAG = WellKnownSetting('is_favorite', False)\n", "path": "mygpo/users/settings.py"}, {"content": "from itertools import chain\nfrom datetime import datetime\n\nfrom django.http import HttpResponseBadRequest, HttpResponseNotFound\nfrom django.contrib.sites.requests import RequestSite\nfrom django.views.decorators.csrf import csrf_exempt\nfrom django.views.decorators.cache import never_cache\nfrom django.utils.decorators import method_decorator\nfrom django.views import View\n\nfrom mygpo.podcasts.models import Episode\nfrom mygpo.api.httpresponse import JsonResponse\nfrom mygpo.api.advanced import episode_action_json\nfrom mygpo.api.advanced.directory import episode_data, podcast_data\nfrom mygpo.utils import parse_bool, get_timestamp\nfrom mygpo.subscriptions import get_subscription_history, subscription_diff\nfrom mygpo.users.models import Client\nfrom mygpo.episodestates.models import EpisodeState\nfrom mygpo.users.subscriptions import subscription_changes, podcasts_for_states\nfrom mygpo.api.basic_auth import require_valid_user, check_username\nfrom mygpo.decorators import cors_origin\n\nfrom collections import namedtuple\nEpisodeStatus = namedtuple('EpisodeStatus', 'episode status action')\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass DeviceUpdates(View):\n    \"\"\" returns various updates for a device\n\n    http://wiki.gpodder.org/wiki/Web_Services/API_2/Devices#Get_Updates \"\"\"\n\n    @method_decorator(csrf_exempt)\n    @method_decorator(require_valid_user)\n    @method_decorator(check_username)\n    @method_decorator(never_cache)\n    @method_decorator(cors_origin())\n    def get(self, request, username, device_uid):\n\n        now = datetime.utcnow()\n        now_ = get_timestamp(now)\n\n        user = request.user\n\n        try:\n            device = user.client_set.get(uid=device_uid)\n        except Client.DoesNotExist as e:\n            return HttpResponseNotFound(str(e))\n\n        try:\n            since = self.get_since(request)\n        except ValueError as e:\n            return HttpResponseBadRequest(str(e))\n\n        include_actions = parse_bool(request.GET.get('include_actions', False))\n\n        domain = RequestSite(request).domain\n\n        add, rem, subscriptions = self.get_subscription_changes(user, device,\n                                                                since, now,\n                                                                domain)\n        updates = self.get_episode_changes(user, subscriptions, domain,\n                                           include_actions, since)\n\n        return JsonResponse({\n            'add': add,\n            'rem': rem,\n            'updates': updates,\n            'timestamp': get_timestamp(now),\n        })\n\n\n    def get_subscription_changes(self, user, device, since, now, domain):\n        \"\"\" gets new, removed and current subscriptions \"\"\"\n\n        history = get_subscription_history(user, device, since, now)\n        add, rem = subscription_diff(history)\n\n        subscriptions = device.get_subscribed_podcasts()\n\n        add = [podcast_data(p, domain) for p in add]\n        rem = [p.url for p in rem]\n\n        return add, rem, subscriptions\n\n\n    def get_episode_changes(self, user, subscriptions, domain, include_actions, since):\n        devices = {dev.id.hex: dev.uid for dev in user.client_set.all()}\n\n        # index subscribed podcasts by their Id for fast access\n        podcasts = {p.get_id(): p for p in subscriptions}\n\n        episode_updates = self.get_episode_updates(user, subscriptions, since)\n\n        return [self.get_episode_data(status, podcasts, domain,\n                include_actions, user, devices) for status in episode_updates]\n\n\n    def get_episode_updates(self, user, subscribed_podcasts, since,\n            max_per_podcast=5):\n        \"\"\" Returns the episode updates since the timestamp \"\"\"\n\n        episodes = []\n        for podcast in subscribed_podcasts:\n            eps = Episode.objects.filter(podcast=podcast,\n                                         released__gt=since)\\\n                                 .order_by('-order', '-released')\n            episodes.extend(eps[:max_per_podcast])\n\n        states = EpisodeState.dict_for_user(user, episodes)\n\n        for episode in episodes:\n            yield EpisodeStatus(episode, states.get(episode.id, 'new'), None)\n\n\n    def get_episode_data(self, episode_status, podcasts, domain, include_actions, user, devices):\n        \"\"\" Get episode data for an episode status object \"\"\"\n\n        # TODO: shouldn't the podcast_id be in the episode status?\n        podcast_id = episode_status.episode.podcast\n        podcast = podcasts.get(podcast_id, None)\n        t = episode_data(episode_status.episode, domain, podcast)\n        t['status'] = episode_status.status\n\n        # include latest action (bug 1419)\n        # TODO\n        if include_actions and episode_status.action:\n            t['action'] = episode_action_json(episode_status.action, user)\n\n        return t\n\n    def get_since(self, request):\n        \"\"\" parses the \"since\" parameter \"\"\"\n        since_ = request.GET.get('since', None)\n        if since_ is None:\n            raise ValueError('parameter since missing')\n        try:\n            return datetime.fromtimestamp(float(since_))\n        except ValueError as e:\n            raise ValueError(\"'since' is not a valid timestamp: %s\" % str(e))\n", "path": "mygpo/api/advanced/updates.py"}], "after_files": [{"content": "from collections import namedtuple\n\n\nWellKnownSetting = namedtuple('WellKnownSetting', 'name default')\n\n## Well-known settings\n# this should be documented at\n# https://gpoddernet.readthedocs.io/en/latest/api//Settings#Known_Settings\n\n# Flag to allow storing of user-agents\nSTORE_UA = WellKnownSetting('store_user_agent', True)\n\n# Flag to mark a subscription as public\nPUBLIC_SUB_PODCAST = WellKnownSetting('public_subscription', True)\n\n# Default public-flag value (stored in the podcast)\nPUBLIC_SUB_USER = WellKnownSetting('public_subscriptions', True)\n\n# Flattr authentication token, empty if not logged in\nFLATTR_TOKEN = WellKnownSetting('flattr_token', '')\n\n# enable auto-flattring\nFLATTR_AUTO = WellKnownSetting('auto_flattr', False)\n\n# auto-flattr mygpo\nFLATTR_MYGPO = WellKnownSetting('flattr_mygpo', False)\n\n# username for flattr buttons for own content\nFLATTR_USERNAME = WellKnownSetting('flattr_username', '')\n\n# Flag to mark an episode as favorite\nFAV_FLAG = WellKnownSetting('is_favorite', False)\n", "path": "mygpo/users/settings.py"}, {"content": "from itertools import chain\nfrom datetime import datetime\n\nfrom django.http import HttpResponseBadRequest, HttpResponseNotFound\nfrom django.contrib.sites.requests import RequestSite\nfrom django.views.decorators.csrf import csrf_exempt\nfrom django.views.decorators.cache import never_cache\nfrom django.utils.decorators import method_decorator\nfrom django.views import View\n\nfrom mygpo.podcasts.models import Episode\nfrom mygpo.api.httpresponse import JsonResponse\nfrom mygpo.api.advanced import episode_action_json\nfrom mygpo.api.advanced.directory import episode_data, podcast_data\nfrom mygpo.utils import parse_bool, get_timestamp\nfrom mygpo.subscriptions import get_subscription_history, subscription_diff\nfrom mygpo.users.models import Client\nfrom mygpo.episodestates.models import EpisodeState\nfrom mygpo.users.subscriptions import subscription_changes, podcasts_for_states\nfrom mygpo.api.basic_auth import require_valid_user, check_username\nfrom mygpo.decorators import cors_origin\n\nfrom collections import namedtuple\nEpisodeStatus = namedtuple('EpisodeStatus', 'episode status action')\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass DeviceUpdates(View):\n    \"\"\" returns various updates for a device\n\n    https://gpoddernet.readthedocs.io/en/latest/api//Devices#Get_Updates \"\"\"\n\n    @method_decorator(csrf_exempt)\n    @method_decorator(require_valid_user)\n    @method_decorator(check_username)\n    @method_decorator(never_cache)\n    @method_decorator(cors_origin())\n    def get(self, request, username, device_uid):\n\n        now = datetime.utcnow()\n        now_ = get_timestamp(now)\n\n        user = request.user\n\n        try:\n            device = user.client_set.get(uid=device_uid)\n        except Client.DoesNotExist as e:\n            return HttpResponseNotFound(str(e))\n\n        try:\n            since = self.get_since(request)\n        except ValueError as e:\n            return HttpResponseBadRequest(str(e))\n\n        include_actions = parse_bool(request.GET.get('include_actions', False))\n\n        domain = RequestSite(request).domain\n\n        add, rem, subscriptions = self.get_subscription_changes(user, device,\n                                                                since, now,\n                                                                domain)\n        updates = self.get_episode_changes(user, subscriptions, domain,\n                                           include_actions, since)\n\n        return JsonResponse({\n            'add': add,\n            'rem': rem,\n            'updates': updates,\n            'timestamp': get_timestamp(now),\n        })\n\n\n    def get_subscription_changes(self, user, device, since, now, domain):\n        \"\"\" gets new, removed and current subscriptions \"\"\"\n\n        history = get_subscription_history(user, device, since, now)\n        add, rem = subscription_diff(history)\n\n        subscriptions = device.get_subscribed_podcasts()\n\n        add = [podcast_data(p, domain) for p in add]\n        rem = [p.url for p in rem]\n\n        return add, rem, subscriptions\n\n\n    def get_episode_changes(self, user, subscriptions, domain, include_actions, since):\n        devices = {dev.id.hex: dev.uid for dev in user.client_set.all()}\n\n        # index subscribed podcasts by their Id for fast access\n        podcasts = {p.get_id(): p for p in subscriptions}\n\n        episode_updates = self.get_episode_updates(user, subscriptions, since)\n\n        return [self.get_episode_data(status, podcasts, domain,\n                include_actions, user, devices) for status in episode_updates]\n\n\n    def get_episode_updates(self, user, subscribed_podcasts, since,\n            max_per_podcast=5):\n        \"\"\" Returns the episode updates since the timestamp \"\"\"\n\n        episodes = []\n        for podcast in subscribed_podcasts:\n            eps = Episode.objects.filter(podcast=podcast,\n                                         released__gt=since)\\\n                                 .order_by('-order', '-released')\n            episodes.extend(eps[:max_per_podcast])\n\n        states = EpisodeState.dict_for_user(user, episodes)\n\n        for episode in episodes:\n            yield EpisodeStatus(episode, states.get(episode.id, 'new'), None)\n\n\n    def get_episode_data(self, episode_status, podcasts, domain, include_actions, user, devices):\n        \"\"\" Get episode data for an episode status object \"\"\"\n\n        # TODO: shouldn't the podcast_id be in the episode status?\n        podcast_id = episode_status.episode.podcast\n        podcast = podcasts.get(podcast_id, None)\n        t = episode_data(episode_status.episode, domain, podcast)\n        t['status'] = episode_status.status\n\n        # include latest action (bug 1419)\n        # TODO\n        if include_actions and episode_status.action:\n            t['action'] = episode_action_json(episode_status.action, user)\n\n        return t\n\n    def get_since(self, request):\n        \"\"\" parses the \"since\" parameter \"\"\"\n        since_ = request.GET.get('since', None)\n        if since_ is None:\n            raise ValueError('parameter since missing')\n        try:\n            return datetime.fromtimestamp(float(since_))\n        except ValueError as e:\n            raise ValueError(\"'since' is not a valid timestamp: %s\" % str(e))\n", "path": "mygpo/api/advanced/updates.py"}]}