internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: akvo/akvo-rsr

Issue:
Reset password not working
Discovered by @rumca https://github.com/akvo/akvo-rsr/issues/1564



Discussion:

Resolving patch:
diff --git a/akvo/rest/views/organisation.py b/akvo/rest/views/organisation.py
--- a/akvo/rest/views/organisation.py
+++ b/akvo/rest/views/organisation.py
@@ -70,7 +70,7 @@ class OrganisationViewSet(BaseRSRViewSet):
     queryset = Organisation.objects.all()
     serializer_class = OrganisationSerializer
     parser_classes = (AkvoOrganisationParser, JSONParser,)
-    filter_fields = ('name', 'long_name', 'iati_org_id', )
+    filter_fields = ('name', 'long_name', 'iati_org_id', 'content_owner')
 
     def get_queryset(self):
         """ Enable filtering of Organisations on iati_org_id or name
diff --git a/akvo/rsr/filters.py b/akvo/rsr/filters.py
--- a/akvo/rsr/filters.py
+++ b/akvo/rsr/filters.py
@@ -19,7 +19,7 @@
 
 from django.utils.translation import ugettext_lazy as _
 
-ANY_CHOICE = (('', 'All'), )
+ANY_CHOICE = (('', _('All')), )
 
 
 def sectors():
@@ -32,7 +32,7 @@ def sectors():
 
 def get_orgs():
     orgs = list(Organisation.objects.all().values_list('id', 'name', flat=False))
-    return [('', 'All')] + orgs
+    return [('', _('All'))] + orgs
 
 
 def remove_empty_querydict_items(request_get):
@@ -68,7 +68,7 @@ def filter_m49(queryset, value):
 
 class ProjectFilter(django_filters.FilterSet):
     category = django_filters.ChoiceFilter(
-        choices=([('', 'All')] +
+        choices=([('', _('All'))] +
                  list(Category.objects.all().values_list('id', 'name',
                                                          flat=False))),
         label=_(u'category'),
@@ -81,13 +81,13 @@ class ProjectFilter(django_filters.FilterSet):
     )
 
     sector = django_filters.ChoiceFilter(
-        initial='All',
-        choices=([('', 'All')] + sectors()),
+        initial=_('All'),
+        choices=([('', _('All'))] + sectors()),
         label=_(u'sector'),
         name='sectors__sector_code')
 
     status = django_filters.ChoiceFilter(
-        initial='All',
+        initial=_('All'),
         label=_(u'status'),
         choices=ANY_CHOICE + Project.STATUSES)
 
@@ -122,8 +122,8 @@ class ProjectUpdateFilter(django_filters.FilterSet):
         name='project__partners__id')
 
     sector = django_filters.ChoiceFilter(
-        initial='All',
-        choices=([('', 'All')] + sectors()),
+        initial=_('All'),
+        choices=([('', _('All'))] + sectors()),
         label=_(u'sector'),
         name='project__sectors__sector_code')
 


Test patch:
Repository: akvo/akvo-rsr

Issue:
Transaction admin creates internal server error



Discussion:

Resolving patch:
diff --git a/akvo/rsr/models/transaction.py b/akvo/rsr/models/transaction.py
--- a/akvo/rsr/models/transaction.py
+++ b/akvo/rsr/models/transaction.py
@@ -89,7 +89,7 @@ class Transaction(models.Model):
     )
 
     def __unicode__(self):
-        return self.value
+        return unicode(self.value)
 
     def iati_currency(self):
         return codelist_value(Currency, self, 'currency')


Test patch:
Repository: akvo/akvo-rsr

Issue:
Indicators (and periods) not showing for non-superusers



Discussion:

Resolving patch:
diff --git a/akvo/rsr/models/__init__.py b/akvo/rsr/models/__init__.py
--- a/akvo/rsr/models/__init__.py
+++ b/akvo/rsr/models/__init__.py
@@ -137,8 +137,13 @@
 rules.add_perm('rsr.add_focusarea', is_rsr_admin)
 rules.add_perm('rsr.change_focusarea', is_rsr_admin)
 
-rules.add_perm('rsr.add_indicator', is_rsr_admin)
-rules.add_perm('rsr.change_indicator', is_rsr_admin)
+rules.add_perm('rsr.add_indicator', is_rsr_admin | is_org_admin | is_org_project_editor)
+rules.add_perm('rsr.change_indicator', is_rsr_admin | is_org_admin | is_org_project_editor)
+rules.add_perm('rsr.delete_indicator', is_rsr_admin | is_org_admin | is_org_project_editor)
+
+rules.add_perm('rsr.add_indicatorperiod', is_rsr_admin | is_org_admin | is_org_project_editor)
+rules.add_perm('rsr.change_indicatorperiod', is_rsr_admin | is_org_admin | is_org_project_editor)
+rules.add_perm('rsr.delete_indicatorperiod', is_rsr_admin | is_org_admin | is_org_project_editor)
 
 rules.add_perm('rsr.add_keyword', is_rsr_admin)
 rules.add_perm('rsr.change_keyword', is_rsr_admin)


Test patch:
Repository: akvo/akvo-rsr

Issue:
Small user interface enhancements
See https://github.com/akvo/akvo-product-design/issues/104
## Test plan
1. "Update list" on directory pages should display "Search"
2. On the project page, in the financial overview part, no cents should be displayed and the total amount funded should be displayed (only visible when donations are activated)
3. On the project full data report page the alignments should be 'fixed', Target group should be visible (when filled in), 'Current situation' is renamed to 'Situation at the start of the project', and the "other" labels in budget items should have the actual label filled in.
4. The financial page is revamped, with a better order of columns (budget on the left, funding in the middle, and summary of those two on the right)
5. One enter in a project update should also display an enter on the project update page (previously this only happened with two enters)
6. On My Projects in MyRSR, the "Update" button should never be too small so that it only displays part of the word (e.g. "Upd...")



Discussion:

Resolving patch:
diff --git a/akvo/rsr/views/project.py b/akvo/rsr/views/project.py
--- a/akvo/rsr/views/project.py
+++ b/akvo/rsr/views/project.py
@@ -469,8 +469,10 @@ def partners(request, project_id):
 def finance(request, project_id):
     """."""
     project = get_object_or_404(Project, pk=project_id)
+    pledged = project.get_pledged()
     context = {
-        'project': project
+        'project': project,
+        'pledged': pledged,
     }
     return render(request, 'project_finance.html', context)
 


Test patch:
Repository: akvo/akvo-rsr

Issue:
Organisation double counting
See screenshot: project page says 'reporting partner ICCO + 2 other partners'. If you hover over the (+2 partners) it shows 2 organisations, of which ICCO is also part. It seems that partners with multiple roles are counted double. 

It would make sense to show 'ICCO + 1 other partner'

![screen shot 2015-06-04 at 10 29 50](https://cloud.githubusercontent.com/assets/4179989/7977978/7d4b24e6-0a90-11e5-9392-a9fa2d1dcee3.png)
## Test plan

GIVEN the project page
WHEN the '+.. other partner' link is shown
THEN the partner that is already displayed should not be counted in the +more section

GIVEN the project page
WHEN there are no other partners than the partner that is displayed
THEN the +more section should not be shown 



Discussion:

Resolving patch:
diff --git a/akvo/rsr/templatetags/rsr_tags.py b/akvo/rsr/templatetags/rsr_tags.py
--- a/akvo/rsr/templatetags/rsr_tags.py
+++ b/akvo/rsr/templatetags/rsr_tags.py
@@ -17,6 +17,18 @@
 register = template.Library()
 
 
+@register.inclusion_tag('inclusion_tags/more_partners.html',
+                        takes_context=True)
+def more_link(context, project):
+    """Generate the more links."""
+    partners = {}
+    for partner in project.all_partners():
+        partners[partner] = partner.has_partner_types(project)
+    return {
+        'project': project,
+        'partners': partners
+    }
+
 @register.inclusion_tag('inclusion_tags/counter_badge.html',
                         takes_context=True)
 def counter_badge(context, object):
diff --git a/akvo/rsr/views/project.py b/akvo/rsr/views/project.py
--- a/akvo/rsr/views/project.py
+++ b/akvo/rsr/views/project.py
@@ -64,7 +64,6 @@ def _project_directory_coll(request):
 
 def directory(request):
     """The project list view."""
-
     qs = remove_empty_querydict_items(request.GET)
 
     # Set show_filters to "in" if any filter is selected


Test patch:
Repository: akvo/akvo-rsr

Issue:
Remove log warning about no location for projects
At the moment, in certain functions that iterate over a collection we log a warning if no geo position is found. This causes a lot of log entries & should be removed to not swamp the log from more important notices.
## Test plan

GIVEN the logs
WHEN the user tries to open a map containing a location with no geo position
THEN this should not be logged



Discussion:

Resolving patch:
diff --git a/akvo/rsr/templatetags/maps.py b/akvo/rsr/templatetags/maps.py
--- a/akvo/rsr/templatetags/maps.py
+++ b/akvo/rsr/templatetags/maps.py
@@ -52,7 +52,7 @@ def avatar(item, geometry='60x60', quality=99):
             url = get_thumbnail(item.photo, geometry,
                                 crop='center', quality=quality).url
     except Exception, e:
-        logger.warning(e)
+        # logger.warning(e)
         pass
 
     return url
@@ -97,7 +97,7 @@ def coll_map(coll, width='100%', height='100%', dynamic='dynamic'):
                  'pk': str(item.pk),
                  'text': text})
         except Exception, e:
-            logger.warning(e)
+            # logger.warning(e)
             pass
 
     return {
@@ -145,7 +145,7 @@ def get_location(item):
                 'pk': str(item.pk),
                 'text': text}
     except Exception, e:
-        logger.warning(e)
+        # logger.warning(e)
         return []
 
 


Test patch:
Repository: akvo/akvo-rsr

Issue:
Sort partners list by name
The partners list of a project (e.g. http://rsr.akvo.org/en/project/3323/partners/) should be sorted by name (A-Z).
## Test plan

GIVEN the partners page of a project
WHEN the page is opened
THEN the order of the partners should be alphabetical



Discussion:

Resolving patch:
diff --git a/akvo/rsr/templatetags/rsr_filters.py b/akvo/rsr/templatetags/rsr_filters.py
--- a/akvo/rsr/templatetags/rsr_filters.py
+++ b/akvo/rsr/templatetags/rsr_filters.py
@@ -1,17 +1,29 @@
-# Akvo RSR is covered by the GNU Affero General Public License.
-# See more details in the license.txt file located at the root folder of the Akvo RSR module. 
-# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
+# -*- coding: utf-8 -*-
+"""
+Akvo RSR is covered by the GNU Affero General Public License.
 
-from django import template
-register = template.Library()
+See more details in the license.txt file located at the root folder of the Akvo RSR module.
+For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
+"""
 
-from django.conf import settings
+import datetime
+import time
 
-import time, datetime
+from django import template
+from django.conf import settings
 from decimal import Decimal, ROUND_HALF_UP
 
+register = template.Library()
+
 DECIMAL_PLACES = getattr(settings, 'DECIMALS_DECIMAL_PLACES', 2)
 
+
+@register.filter
+def get_item(dictionary, key):
+    """Enable lookup in dicts."""
+    return dictionary.get(key)
+
+
 @register.filter
 def string_to_date(value):
     try:
@@ -64,4 +76,3 @@ def rsr_sorted_set(iterable):
     set_list = list(frozenset(iterable))
     set_list.sort()
     return set_list
-
diff --git a/akvo/rsr/views/project.py b/akvo/rsr/views/project.py
--- a/akvo/rsr/views/project.py
+++ b/akvo/rsr/views/project.py
@@ -18,7 +18,7 @@
 
 from ..forms import ProjectUpdateForm
 from ..filters import remove_empty_querydict_items, ProjectFilter
-from ..models import Invoice, Project, ProjectUpdate
+from ..models import Invoice, Project, ProjectUpdate, Organisation
 from ...utils import pagination, filter_query_string
 from ...iati.iati_export import IatiXML
 from .utils import apply_keywords, org_projects
@@ -455,13 +455,20 @@ def search(request):
     context = {'projects': Project.objects.published()}
     return render(request, 'project_search.html', context)
 
+
 def partners(request, project_id):
     """."""
     project = get_object_or_404(Project, pk=project_id)
-    partners = _get_project_partners(project)
+    partner_vals = project.all_partners().values()
+    for partner in partner_vals:
+        id_key = "id".decode('unicode-escape')
+        p = Organisation.objects.get(pk=partner[id_key])
+        partner['partner_types'] = p.has_partner_types(project)
+    partner_types = _get_project_partners(project)
     context = {
         'project': project,
-        'partners': partners
+        'partner_vals': partner_vals,
+        'partner_types': partner_types
     }
     return render(request, 'project_partners.html', context)
 


Test patch:
Repository: akvo/akvo-rsr

Issue:
Add a default Organsiation Logo image
- [x] Finalise image decision
- [x] Implement new image
## Test plan

GIVEN the organisation directory page
WHEN an organisation has no logo
THEN the image as shown below should be displayed



Discussion:
Here's the image from Linda:
![rsr_no-logo-v2](https://cloud.githubusercontent.com/assets/1426234/5776542/5ab10b4a-9d89-11e4-8a6c-1e47dc25d155.jpg)

Maybe we should also use one of these for when a project has no image:
![screen shot 2015-03-04 at 13 38 16](https://cloud.githubusercontent.com/assets/1426234/6483706/57a5edb6-c274-11e4-9bfb-cea0e7fae4d9.png)

Let's ask @loicsans and/or @gabemart what they think.


Resolving patch:
diff --git a/akvo/rsr/templatetags/rsr_utils.py b/akvo/rsr/templatetags/rsr_utils.py
--- a/akvo/rsr/templatetags/rsr_utils.py
+++ b/akvo/rsr/templatetags/rsr_utils.py
@@ -8,6 +8,7 @@
 from __future__ import absolute_import, print_function
 
 from django import template
+from django.conf import settings
 from django.contrib.auth import get_user_model
 from akvo.rsr.models import Keyword, PartnerSite, Project, ProjectUpdate, Organisation
 register = template.Library()
@@ -16,16 +17,22 @@
 @register.inclusion_tag('rsr_utils/img.html', takes_context=True)
 def img(context, obj, width, height, alt):
     """Standard way to show image."""
-    geometry = '{}x{}'.format(width, height)
+    img = ""
+    geometry = "{}x{}".format(width, height)
+    default_img = "//placehold.it/{}".format(geometry)
 
-    # Based on type get image
-    img = obj
     if isinstance(obj, Project):
         img = obj.current_image
     elif isinstance(obj, ProjectUpdate):
         img = obj.photo
     elif isinstance(obj, Organisation):
-        img = obj.logo
+        if obj.logo:
+            img = obj.logo
+        else:
+            default_img = "//{}{}{}".format(
+                context["request"].get_host(),
+                getattr(settings, "STATIC_URL"),
+                "images/default-org-logo.jpg")
     elif isinstance(obj, get_user_model()):
         img = obj.avatar
     elif isinstance(obj, PartnerSite):
@@ -33,13 +40,10 @@ def img(context, obj, width, height, alt):
     elif isinstance(obj, Keyword):
         img = obj.logo
 
-    height = '{}.px'.format(height)
-
-    return {'alt': alt,
-            'height': height,
-            'img': img,
-            'geometry': geometry,
-            'width': width}
+    return {"default_img": default_img,
+            "geometry": geometry,
+            "img": img,
+            "alt": alt}
 
 
 @register.inclusion_tag('rsr_utils/vid_img.html', takes_context=True)


Test patch:
Repository: akvo/akvo-rsr

Issue:
IATI partner types
https://github.com/akvo/akvo-product-design/issues/84



Discussion:

Resolving patch:
diff --git a/akvo/rsr/migrations/0015_auto_20150722_1519.py b/akvo/rsr/migrations/0015_auto_20150722_1519.py
new file mode 100644
--- /dev/null
+++ b/akvo/rsr/migrations/0015_auto_20150722_1519.py
@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import models, migrations
+import akvo.rsr.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('rsr', '0014_auto_20150721_1343'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='partnership',
+            name='partner_type',
+            field=akvo.rsr.fields.ValidXMLCharField(choices=[('field', 'Implementing partner'), ('funding', 'Funding partner'), ('sponsor', 'Sponsor partner'), ('support', 'Accountable partner'), ('extending', 'Extending partner')], max_length=9, blank=True, help_text='Select the role that the organisation is taking within the project.', verbose_name='partner type', db_index=True),
+            preserve_default=True,
+        ),
+    ]
diff --git a/akvo/rsr/models/partnership.py b/akvo/rsr/models/partnership.py
--- a/akvo/rsr/models/partnership.py
+++ b/akvo/rsr/models/partnership.py
@@ -16,13 +16,17 @@ class Partnership(models.Model):
     FUNDING_PARTNER = u'funding'
     SPONSOR_PARTNER = u'sponsor'
     SUPPORT_PARTNER = u'support'
+    EXTENDING_PARTNER = u'extending'
 
-    PARTNER_TYPE_LIST = [FIELD_PARTNER, FUNDING_PARTNER, SPONSOR_PARTNER, SUPPORT_PARTNER, ]
+    PARTNER_TYPE_LIST = [
+        FIELD_PARTNER, FUNDING_PARTNER, SPONSOR_PARTNER, SUPPORT_PARTNER, EXTENDING_PARTNER
+    ]
     PARTNER_LABELS = [
-        _(u'Field partner'),
+        _(u'Implementing partner'),
         _(u'Funding partner'),
         _(u'Sponsor partner'),
-        _(u'Support partner')
+        _(u'Accountable partner'),
+        _(u'Extending partner'),
     ]
 
     PARTNER_TYPES = zip(PARTNER_TYPE_LIST, PARTNER_LABELS)
@@ -45,7 +49,7 @@ class Partnership(models.Model):
         help_text=_(u'Select an organisation that is taking an active role in the project.'))
     project = models.ForeignKey('Project', verbose_name=_(u'project'), related_name='partnerships')
     partner_type = ValidXMLCharField(
-        _(u'partner type'), max_length=8, db_index=True, choices=PARTNER_TYPES, blank=True,
+        _(u'partner type'), max_length=9, db_index=True, choices=PARTNER_TYPES, blank=True,
         help_text=_(u'Select the role that the organisation is taking within the project.'))
     funding_amount = models.DecimalField(
         _(u'funding amount'), max_digits=10, decimal_places=2, blank=True, null=True, db_index=True,


Test patch:
Repository: akvo/akvo-rsr

Issue:
Project partner alignment
## Test plan

GIVEN the project partners page
WHEN viewing the partners
THEN there should be an organisation logo or placeholder displayed for every partner
## Issue description

Project partners should all have same alignment. Now some align left, while others centre, see screenshot

![screen shot 2015-07-21 at 11 43 02](https://cloud.githubusercontent.com/assets/4179989/8797777/f709132e-2f9d-11e5-99f7-a6c6edb5b56c.png)



Discussion:

Resolving patch:
diff --git a/akvo/rsr/views/project.py b/akvo/rsr/views/project.py
--- a/akvo/rsr/views/project.py
+++ b/akvo/rsr/views/project.py
@@ -463,6 +463,7 @@ def partners(request, project_id):
         id_key = "id".decode('unicode-escape')
         p = Organisation.objects.get(pk=partner[id_key])
         partner['partner_types'] = p.has_partner_types(project)
+        partner['organisation_obj'] = p
     partner_types = _get_project_partners(project)
     context = {
         'project': project,


Test patch:
Repository: akvo/akvo-rsr

Issue:
User permissions for deleting employments
Currently the organisation Admins and User Managers do not have the right to delete an employment. As they are managing these employments, they should be able to do so.
## Test plan

GIVEN the user management page
WHEN logged in as an Organisation Admin or User Manager
THEN the user should be able to delete employments



Discussion:

Resolving patch:
diff --git a/akvo/rsr/models/__init__.py b/akvo/rsr/models/__init__.py
--- a/akvo/rsr/models/__init__.py
+++ b/akvo/rsr/models/__init__.py
@@ -265,6 +265,7 @@
 
 rules.add_perm('rsr.add_employment', is_rsr_admin)
 rules.add_perm('rsr.change_employment', is_rsr_admin | is_org_admin | is_org_user_manager)
+rules.add_perm('rsr.delete_employment', is_rsr_admin | is_org_admin | is_org_user_manager)
 
 rules.add_perm('rsr.iati_management', is_rsr_admin | is_org_admin | is_org_project_editor)
 


Test patch:
Repository: akvo/akvo-rsr

Issue:
Remove the unique together constraint from budget items
## Test plan

GIVEN the Vagrant machine
WHEN the `./manage.sh makemigrations rsr` command is performed in the scripts/devhelpers folder
THEN no changes should be found



Discussion:

Resolving patch:
diff --git a/akvo/rsr/migrations/0001_initial.py b/akvo/rsr/migrations/0001_initial.py
--- a/akvo/rsr/migrations/0001_initial.py
+++ b/akvo/rsr/migrations/0001_initial.py
@@ -1041,10 +1041,6 @@ class Migration(migrations.Migration):
             field=models.ForeignKey(related_name='budget_items', verbose_name='project', to='rsr.Project'),
             preserve_default=True,
         ),
-        migrations.AlterUniqueTogether(
-            name='budgetitem',
-            unique_together=set([('project', 'label')]),
-        ),
         migrations.AddField(
             model_name='benchmark',
             name='category',


Test patch:
Repository: akvo/akvo-rsr

Issue:
MyRSR User search filter lost on pagination
On the User Management section of MyRSR, when a user searches for a name which returns multiple results (for example 'test') and is therefore paginated, when they click to navigate to the next page of results the search term is dropped and the second page of all results is returned instead.



Discussion:

Resolving patch:
diff --git a/akvo/rsr/views/my_rsr.py b/akvo/rsr/views/my_rsr.py
--- a/akvo/rsr/views/my_rsr.py
+++ b/akvo/rsr/views/my_rsr.py
@@ -380,6 +380,7 @@ def user_management(request):
                 employments.filter(user__first_name__icontains=q_item) | \
                 employments.filter(user__last_name__icontains=q_item)
 
+    qs = remove_empty_querydict_items(request.GET)
     page = request.GET.get('page')
     page, paginator, page_range = pagination(page, employments, 10)
 
@@ -421,5 +422,7 @@ def user_management(request):
     context['paginator'] = paginator
     context['page_range'] = page_range
     if q:
-        context['q'] = q
+        context['q_search'] = q
+    context['q'] = filter_query_string(qs)
+
     return render(request, 'myrsr/user_management.html', context)


Test patch:
Repository: akvo/akvo-rsr

Issue:
Prevent automatic publishing of projects
## Test plan

GIVEN a project that is going to be published
WHEN the project is published
THEN a notification mail will be sent to Kasper
## Issue description

Somehow there are projects (mainly from Commonsites and Akvo) that get published automatically, even though they shouldn't be. This should be prevented and fixed.

Note; I can't find the reason why this happens. I suspect the API, but then again, this only happens for Akvo and Commonsites projects. Therefore I'll monitor it for now.



Discussion:

Resolving patch:
diff --git a/akvo/rsr/models/publishing_status.py b/akvo/rsr/models/publishing_status.py
--- a/akvo/rsr/models/publishing_status.py
+++ b/akvo/rsr/models/publishing_status.py
@@ -4,8 +4,12 @@
 # See more details in the license.txt file located at the root folder of the Akvo RSR module.
 # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
 
+from django.conf import settings
 from django.core.exceptions import ValidationError
+from django.core.mail import send_mail
 from django.db import models
+from django.db.models.signals import post_save
+from django.dispatch import receiver
 from django.utils.translation import ugettext_lazy as _
 
 from ..fields import ValidXMLCharField
@@ -148,3 +152,15 @@ class Meta:
         verbose_name = _(u'publishing status')
         verbose_name_plural = _(u'publishing statuses')
         ordering = ('-status', 'project')
+
+
+@receiver(post_save, sender=PublishingStatus)
+def update_denormalized_project(sender, **kwargs):
+    "Send notification that a project is published."
+    publishing_status = kwargs['instance']
+    if publishing_status.status == PublishingStatus.STATUS_PUBLISHED:
+        send_mail(
+            'Project %s has been published' % str(publishing_status.project.pk),
+            '', getattr(settings, "DEFAULT_FROM_EMAIL", "noreply@akvo.org"),
+            getattr(settings, "NOTIFY_PUBLISH", ["kasper@akvo.org"])
+        )


Test patch: