internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: liqd/a4-meinberlin

Issue:
preview in text commenting does not work
URL: https://meinberlin-dev.liqd.net/dashboard/projects/textkommentierung/basic/
user: initiator
expected behaviour: should be able to see preview
behaviour: get 405 error
Comment/Question: I checked brainstorming and it works. After I enter content for the document it also works, so I guess it has to do with the module text commenting. We also have the problem on prod, so I guess we need a hot fix.


Discussion:
So, it works, when there is a document, but not if there's none?
hmm, did this ever work? What would you expect to see there? The project header with nothing underneath? I could image that this will be fixed with the new dashboard as we have to deal with a project previews where no module has been added.
@MagdaN: for brainstorming and ideacollection with or without map and topicprio it does show the header and/or phase description and some grey area for the map. 

<img width="704" alt="Bildschirmfoto 2019-10-28 um 09 24 53" src="https://user-images.githubusercontent.com/35491681/67663067-f7be4b00-f964-11e9-90c7-d19c4d1d6543.png">

for poll there is also a 405 but with more info.
<img width="602" alt="Bildschirmfoto 2019-10-28 um 09 23 06" src="https://user-images.githubusercontent.com/35491681/67663108-0c024800-f965-11e9-969f-4d5b17399c44.png">

the first is nicer, the second is ok. Good point that it might be related to dashboard. Maybe you want to put this issue as a task within the story so we don't forget?

@CarolingerSeilchenspringer I added a task

Resolving patch:
diff --git a/meinberlin/apps/documents/views.py b/meinberlin/apps/documents/views.py
--- a/meinberlin/apps/documents/views.py
+++ b/meinberlin/apps/documents/views.py
@@ -1,7 +1,5 @@
-from django.http import Http404
 from django.urls import reverse
 from django.utils.functional import cached_property
-from django.utils.translation import ugettext_lazy as _
 from django.views import generic
 
 from adhocracy4.dashboard import mixins as dashboard_mixins
@@ -58,9 +56,6 @@ def get_object(self):
         first_chapter = models.Chapter.objects \
             .filter(module=self.module) \
             .first()
-
-        if not first_chapter:
-            raise Http404(_('Document has no chapters defined.'))
         return first_chapter
 
 


Test patch:
Repository: liqd/a4-meinberlin

Issue:
testing 2394: moderation cannot add module
**URL:** https://meinberlin-dev.liqd.net/dashboard/projects/testing-dashbaord/basic/
**user:** moderator
**expected behaviour:** can create module
**behaviour:** cannot create module
**important screensize:**
**device & browser:** 
**Comment/Question:** We should allow this. In the long run we should reconsider general project changing rights to moderators. Now that we have groups we might no longer need it. 




Discussion:
These are two questions:
1. Who should be allowed to add a module? Currently only users who are allowed to add a project are also allowed to add a module. You said, that everyone allowed to change a project should be able to add a module, right?
2. Should moderators be allowed to change a project they are moderating? We should tackle that later as this is quite a big change for the (dashboard) users.
@fuzzylogic2000 ok, now I get the logic and it makes sense that moderators can only change an existing project but not add one or add a module to a project. But I just checked again: they can delete modules and add/disconnect them with the project. I would restrict all that because we have groups. But maybe we should discuss this again with other PMs/PO and have the same solution there that works for all platforms?

Resolving patch:
diff --git a/meinberlin/apps/dashboard/views.py b/meinberlin/apps/dashboard/views.py
--- a/meinberlin/apps/dashboard/views.py
+++ b/meinberlin/apps/dashboard/views.py
@@ -24,7 +24,7 @@ class ModuleBlueprintListView(ProjectMixin,
                               mixins.BlueprintMixin,
                               generic.DetailView):
     template_name = 'meinberlin_dashboard/module_blueprint_list_dashboard.html'
-    permission_required = 'a4projects.add_project'
+    permission_required = 'a4projects.change_project'
     model = project_models.Project
     slug_url_kwarg = 'project_slug'
     menu_item = 'project'
@@ -34,7 +34,7 @@ def blueprints(self):
         return get_blueprints()
 
     def get_permission_object(self):
-        return self.organisation
+        return self.project
 
 
 class ModuleCreateView(ProjectMixin,
@@ -42,7 +42,7 @@ class ModuleCreateView(ProjectMixin,
                        mixins.BlueprintMixin,
                        SingleObjectMixin,
                        generic.View):
-    permission_required = 'a4projects.add_project'
+    permission_required = 'a4projects.change_project'
     model = project_models.Project
     slug_url_kwarg = 'project_slug'
 
@@ -92,7 +92,7 @@ def get_next(self, module):
         })
 
     def get_permission_object(self):
-        return self.organisation
+        return self.project
 
 
 class ModulePublishView(SingleObjectMixin,


Test patch:
Repository: liqd/a4-meinberlin

Issue:
User testing 2394: add module button placement and wording
URL: https://meinberlin-dev.liqd.net/dashboard/modules/
user: initiator/group member
expected behaviour:
behaviour: move 'add module' button to below the project menu and swap order of added modules so newest first, update wording to 'show in project'
important screensize: all
device & browser: all



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/dashboard/views.py b/meinberlin/apps/dashboard/views.py
--- a/meinberlin/apps/dashboard/views.py
+++ b/meinberlin/apps/dashboard/views.py
@@ -67,7 +67,14 @@ def post(self, request, *args, **kwargs):
         self._create_module_settings(module)
         self._create_phases(module, self.blueprint.content)
 
-        return HttpResponseRedirect(self.get_next(module))
+        closed = request.COOKIES.get('closed_accordeons', '')
+        closed_project_accordeon = \
+            'dashboard-nav__project--{}'.format(str(self.project.id))
+        if closed_project_accordeon not in closed:
+            closed = closed_project_accordeon + closed
+        response = HttpResponseRedirect(self.get_next(module))
+        response.set_cookie('closed_accordeons', closed)
+        return response
 
     def _create_module_settings(self, module):
         if self.blueprint.settings_model:


Test patch:
Repository: liqd/a4-meinberlin

Issue:
Firefox issue: The dropdownn toggle-button is on top of the search button of the freetext-filter
![35799923-a06c4eda-0a67-11e8-813f-e30b7f4afc07](https://user-images.githubusercontent.com/2905743/35805715-3a5c95e4-0a7d-11e8-8868-1bc72512b71a.png)

This issue only appears on Firefox when using the small screen debugging mode


Discussion:
That's odd. The search button is part of the search form, but for some reason it's rendered outside of it. So basically the button has end where currently the search block ends.

Still present in FF 68 and nightly btw.
I just checked this again and it still does that when screen size is smaller than 450px. @phillimorland said we should test down to 375px so I guess we should have a look at it again.

Resolving patch:
diff --git a/meinberlin/config/settings/base.py b/meinberlin/config/settings/base.py
--- a/meinberlin/config/settings/base.py
+++ b/meinberlin/config/settings/base.py
@@ -335,13 +335,13 @@
     'default': {
         'tags': ['p', 'strong', 'em', 'u', 'ol', 'li', 'ul', 'a'],
         'attributes': {
-            'a': ['href', 'rel'],
+            'a': ['href', 'rel', 'target'],
         },
     },
     'image-editor': {
         'tags': ['p', 'strong', 'em', 'u', 'ol', 'li', 'ul', 'a', 'img'],
         'attributes': {
-            'a': ['href', 'rel'],
+            'a': ['href', 'rel', 'target'],
             'img': ['src', 'alt', 'style']
         },
         'styles': [
@@ -360,7 +360,7 @@
         'tags': ['p', 'strong', 'em', 'u', 'ol', 'li', 'ul', 'a', 'img',
                  'div'],
         'attributes': {
-            'a': ['href', 'rel'],
+            'a': ['href', 'rel', 'target'],
             'img': ['src', 'alt', 'style'],
             'div': ['class']
         },


Test patch:
Repository: liqd/a4-meinberlin

Issue:
ValueError: Missing staticfiles manifest entry for 'js/select_dropdown_init.js'
https://sentry.liqd.net/sentry/meinberlin-dev/issues/1032/

```
ValueError: Missing staticfiles manifest entry for 'js/select_dropdown_init.js'
(35 additional frame(s) were not displayed)
...
  File "django/templatetags/static.py", line 118, in handle_simple
    return staticfiles_storage.url(path)
  File "django_cloudflare_push/middleware.py", line 47, in url
    return super(DebugStaticFilesStorage, self).url(path)
  File "django/contrib/staticfiles/storage.py", line 153, in url
    return self._url(self.stored_name, name, force)
  File "django/contrib/staticfiles/storage.py", line 132, in _url
    hashed_name = hashed_name_func(*args)
  File "django/contrib/staticfiles/storage.py", line 420, in stored_name
    raise ValueError("Missing staticfiles manifest entry for '%s'" % clean_name)

Internal Server Error: /kiezkasse/create/module/kiezkasse-2/
```


Discussion:
path should be renamed, can't find place it's though?! 
https://github.com/liqd/adhocracy4/pull/464/files

Resolving patch:
diff --git a/meinberlin/apps/mapideas/forms.py b/meinberlin/apps/mapideas/forms.py
--- a/meinberlin/apps/mapideas/forms.py
+++ b/meinberlin/apps/mapideas/forms.py
@@ -22,7 +22,7 @@ def __init__(self, *args, **kwargs):
             'Please locate your proposal on the map.')
 
     class Media:
-        js = ('js/select_dropdown_init.js',)
+        js = ('select_dropdown_init.js',)
 
     class Meta:
         model = models.MapIdea


Test patch:
Repository: liqd/a4-meinberlin

Issue:
only module can be removed from published project
**URL:** https://meinberlin-dev.liqd.net/dashboard/projects/lorem-ipsum/basic/
**user:** initiator
**expected behaviour:** when a project is published, at least one modle should always be added to the project, the initiator shouldn't be able to remove the last one 
**behaviour:** last added module can be removed, resulting ind strange project detail view ("Die Beteiligung ist aktuell nicht möglich. Sie startet am None. ") with an empty project without any participation.
**important screensize:**
**device & browser:** 
**Comment/Question:** @CarolingerSeilchenspringer I am not sure we decided it should be like that (or can you just not delete the last module and only delete it after it has been removed?), but I think this needs to be fixed. Do you agree?

Screenshot?



Discussion:
@fuzzylogic2000 this is strange because I am almost certain it wasn't like this when I tested. The remove button needs to be inactive for the last module of a published project. Totally agree!

Resolving patch:
diff --git a/meinberlin/apps/dashboard/templatetags/meinberlin_dashboard_tags.py b/meinberlin/apps/dashboard/templatetags/meinberlin_dashboard_tags.py
--- a/meinberlin/apps/dashboard/templatetags/meinberlin_dashboard_tags.py
+++ b/meinberlin/apps/dashboard/templatetags/meinberlin_dashboard_tags.py
@@ -35,7 +35,7 @@ def has_unpublishable_modules(project):
     another module published for (added to) the project.
     """
     return (project.is_draft
-            and project.published_modules.count() <= 1)
+            and project.published_modules.count() > 1)
 
 
 @register.filter
diff --git a/meinberlin/apps/dashboard/views.py b/meinberlin/apps/dashboard/views.py
--- a/meinberlin/apps/dashboard/views.py
+++ b/meinberlin/apps/dashboard/views.py
@@ -161,6 +161,16 @@ def unpublish_module(self):
         if module.is_draft:
             messages.info(self.request, _('Module is already removed'))
             return
+        if not module.project.is_draft:
+            messages.error(self.request,
+                           _('Module cannot be removed '
+                             'from a published project.'))
+            return
+        if module.project.published_modules.count() == 1:
+            messages.error(self.request,
+                           _('Module cannot be removed. '
+                             'It is the only module added to the project.'))
+            return
 
         module.is_draft = True
         module.save()


Test patch:
Repository: liqd/a4-meinberlin

Issue:
testing 2956: add platform mail
* footer needs to be changed (see comments of story in taiga)
* change wording in dropdown to "Plattform-Mail" in German
* pre-entered name "meinberlin" should be changed to "meinBerlin"
* missing translation

Please note: two related issues (concerning newsletter in general) are still open:
#2933  
#2932 





Discussion:
"meinberlin" still missing.

Resolving patch:
diff --git a/meinberlin/config/settings/base.py b/meinberlin/config/settings/base.py
--- a/meinberlin/config/settings/base.py
+++ b/meinberlin/config/settings/base.py
@@ -246,7 +246,7 @@
 
 # Wagtail settings
 
-WAGTAIL_SITE_NAME = 'meinberlin'
+WAGTAIL_SITE_NAME = 'meinBerlin'
 WAGTAILIMAGES_IMAGE_MODEL = 'meinberlin_cms.CustomImage'
 
 # Base URL to use when referring to full URLs within the Wagtail admin backend -


Test patch:
Repository: liqd/a4-meinberlin

Issue:
test 2959: redesign mail of new Stellungnahme in b-plan module
**URL:** mail
**user:** sachbearbeiter
**expected behaviour:** logo is no longer in the email
**behaviour:** logo is on the bottom left corner of the mail, outside the mail layout box 
**important screensize:**
**device & browser:** mail on mac
**Comment/Question:** 

Screenshot?
<img width="776" alt="Bildschirmfoto 2020-05-25 um 15 44 09" src="https://user-images.githubusercontent.com/35491681/82819838-5e76f900-9ea1-11ea-99a9-9a531588387f.png">




Discussion:

Resolving patch:
diff --git a/meinberlin/apps/bplan/emails.py b/meinberlin/apps/bplan/emails.py
--- a/meinberlin/apps/bplan/emails.py
+++ b/meinberlin/apps/bplan/emails.py
@@ -27,6 +27,9 @@ def get_context(self):
         context['identifier'] = self.bplan_identifier
         return context
 
+    def get_attachments(self):
+        return []
+
 
 class SubmitterConfirmation(Email):
     template_name = 'meinberlin_bplan/emails/submitter_confirmation'


Test patch:
Repository: liqd/a4-meinberlin

Issue:
testing 2958: bplan verification mail
**URL:** mail
**user:** administration staff working via imperia
**expected behaviour:** /
**behaviour:** wording changed, see below
**important screensize:**/
**device & browser:** /
**Comment/Question:**

- cross out the word "Betreff" in e-mail-subject

- correct "Projektü**n**ersicht" to "Projektübersicht"

- can you write "Uhr" behind date and time?

- I already know that it is complicated to separate date and time via comma, I guess this hasn't changed?

- the word "identifier" shouldn't be there but I guess it is only there because you entered it into the field together with the identifier itself, right?

Screenshot?
<img width="707" alt="Bildschirmfoto 2020-07-02 um 12 25 14" src="https://user-images.githubusercontent.com/35491681/86348098-7ccdd280-bc5f-11ea-9fb7-010f71c1a1a9.png">





Discussion:

Resolving patch:
diff --git a/meinberlin/apps/bplan/signals.py b/meinberlin/apps/bplan/signals.py
--- a/meinberlin/apps/bplan/signals.py
+++ b/meinberlin/apps/bplan/signals.py
@@ -25,5 +25,5 @@ def send_notification(sender, instance, created, **kwargs):
 
 @receiver(post_save, sender=Bplan)
 def send_update(sender, instance, update_fields, **kwargs):
-    if update_fields:
+    if not update_fields or 'point' not in update_fields:
         emails.OfficeWorkerUpdateConfirmation.send(instance)


Test patch:
Repository: liqd/a4-meinberlin

Issue:
[dev/stage] add helptext to platform mail regarding width of picture
**URL:** https://meinberlin-stage.liqd.net/platform-emails/create/
**user:** admin
**expected behaviour:** 
**behaviour:** 
**important screensize:**
**device & browser:** 
**Comment/Question:** in the newsletter we had problems with pictures wider than 650px and I guess it is the same here. We can't solve that problem but decided to add a helptext. I would suggest we copy that helptext here as well as it is the same form.

Screenshot?



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/platformemails/migrations/0002_add_img_helptext.py b/meinberlin/apps/platformemails/migrations/0002_add_img_helptext.py
new file mode 100644
--- /dev/null
+++ b/meinberlin/apps/platformemails/migrations/0002_add_img_helptext.py
@@ -0,0 +1,19 @@
+# Generated by Django 2.2.14 on 2020-07-13 11:36
+
+import ckeditor_uploader.fields
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('meinberlin_platformemails', '0001_initial'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='platformemail',
+            name='body',
+            field=ckeditor_uploader.fields.RichTextUploadingField(blank=True, help_text='When adding images, please ensure to set the width no larger than 650px.', verbose_name='Email body'),
+        ),
+    ]
diff --git a/meinberlin/apps/platformemails/models.py b/meinberlin/apps/platformemails/models.py
--- a/meinberlin/apps/platformemails/models.py
+++ b/meinberlin/apps/platformemails/models.py
@@ -20,7 +20,10 @@ class PlatformEmail(UserGeneratedContentModel):
                                verbose_name=_('Subject'))
     body = RichTextUploadingField(blank=True,
                                   config_name='image-editor',
-                                  verbose_name=_('Email body'))
+                                  verbose_name=_('Email body'),
+                                  help_text=_(
+                                      'When adding images, please ensure to '
+                                      'set the width no larger than 650px.'))
     sent = models.DateTimeField(blank=True,
                                 null=True,
                                 verbose_name=_('Sent'))


Test patch:
Repository: liqd/a4-meinberlin

Issue:
[dev/stage] auto-fill-in overwrites my bplan-name
**URL:** https://meinberlin-stage.liqd.net/dashboard/projects/caro-testing-new-bplan-mail-2/bplan/
**user:** initiator addin bplan
**expected behaviour:** I can use autofill to add my mail-address
**behaviour:** if I do so, the title of bplan is overwritten by my name but as it is far up the form I don't notice it.
**important screensize:**
**device & browser:** mac, chrome
**Comment/Question:** is that even something we can influence?

Screenshot?
<img width="673" alt="Bildschirmfoto 2020-07-10 um 11 02 30" src="https://user-images.githubusercontent.com/35491681/87137579-6b0eaf80-c29d-11ea-928f-c888dc8eb430.png">
<img width="673" alt="Bildschirmfoto 2020-07-10 um 11 06 10" src="https://user-images.githubusercontent.com/35491681/87137586-6cd87300-c29d-11ea-965d-74b4ecba8bc8.png">




Discussion:

Resolving patch:
diff --git a/meinberlin/apps/bplan/forms.py b/meinberlin/apps/bplan/forms.py
--- a/meinberlin/apps/bplan/forms.py
+++ b/meinberlin/apps/bplan/forms.py
@@ -29,3 +29,9 @@ class Meta:
                   'start_date', 'end_date']
         required_for_project_publish = ['name', 'url', 'description',
                                         'office_worker_email']
+
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self.fields['name'].widget.attrs.update({
+            'autocomplete': 'off', 'autofill': 'off'
+        })


Test patch:
Repository: liqd/a4-meinberlin

Issue:
testing interactive event: remove + on call to action
**URL:** https://meinberlin-dev.liqd.net/projekte/module/interaktive-veranstaltung-2/
**user:** unregistered user
**expected behaviour:** buttons should be same all over platform
**behaviour:** there is a + on the button
**important screensize:**
**device & browser:** 
**Comment/Question:** please take out the + before add question


Screenshot?
<img width="692" alt="Bildschirmfoto 2020-09-22 um 17 51 38" src="https://user-images.githubusercontent.com/35491681/93906276-494d9200-fcfc-11ea-9614-3a9359b5ec97.png">



Discussion:

Resolving patch:
diff --git a/meinberlin/apps/livequestions/phases.py b/meinberlin/apps/livequestions/phases.py
--- a/meinberlin/apps/livequestions/phases.py
+++ b/meinberlin/apps/livequestions/phases.py
@@ -13,7 +13,7 @@ class IssuePhase(phases.PhaseContent):
     view = views.LiveQuestionModuleDetail
 
     name = _('Issue phase')
-    description = _('Add question.')
+    description = _('Add questions and support.')
     module_name = _('Interactive Event')
     icon = 'lightbulb-o'
 
diff --git a/meinberlin/apps/projects/templatetags/meinberlin_project_tags.py b/meinberlin/apps/projects/templatetags/meinberlin_project_tags.py
--- a/meinberlin/apps/projects/templatetags/meinberlin_project_tags.py
+++ b/meinberlin/apps/projects/templatetags/meinberlin_project_tags.py
@@ -4,6 +4,8 @@
 from meinberlin.apps.budgeting.models import Proposal as budget_proposal
 from meinberlin.apps.ideas.models import Idea
 from meinberlin.apps.kiezkasse.models import Proposal as kiezkasse_proposal
+from meinberlin.apps.likes.models import Like
+from meinberlin.apps.livequestions.models import LiveQuestion
 from meinberlin.apps.mapideas.models import MapIdea
 from meinberlin.apps.polls.models import Vote
 from meinberlin.apps.projects import get_project_type
@@ -54,5 +56,7 @@ def get_num_entries(module):
         + Comment.objects.filter(paragraph__chapter__module=module).count() \
         + Comment.objects.filter(chapter__module=module).count() \
         + Comment.objects.filter(poll__module=module).count() \
-        + Vote.objects.filter(choice__question__poll__module=module).count()
+        + Vote.objects.filter(choice__question__poll__module=module).count() \
+        + LiveQuestion.objects.filter(module=module).count() \
+        + Like.objects.filter(question__module=module).count()
     return item_count


Test patch:
Repository: liqd/a4-meinberlin

Issue:
#3491 [mB] add video embed to interactive event 
**URL:** https://meinberlin-dev.liqd.net/projekte/design-project/
**device & browser:** *Safari Version 14.0 (15610.1.28.1.9, 15610)*
**Comment/Question:** 
*Just to confirm, the live stream field should appear just when the project is published? Cause, I can't select the live stream section before being published, otherwise all good*  

<img width="1361" alt="Screenshot 2020-11-10 at 16 03 41" src="https://user-images.githubusercontent.com/59610786/98691968-e462ff80-236e-11eb-904b-755ff83b79cc.png">
<img width="1389" alt="Screenshot 2020-11-10 at 16 04 07" src="https://user-images.githubusercontent.com/59610786/98691978-e7f68680-236e-11eb-9a18-53ade0537fa8.png">
<img width="1330" alt="Screenshot 2020-11-10 at 16 04 24" src="https://user-images.githubusercontent.com/59610786/98691980-e927b380-236e-11eb-88a8-ad2c644e58df.png">




Discussion:
@fuzzylogic2000 were you on this? it sounded like you knew what the problem was during standup? if not I can take a look

@phillimorland I've only seen it and knew, where I didn't really read, what I copied. It's here: https://github.com/liqd/a4-meinberlin/blob/842bcc2dee35488df471d952cfd1c401358a9078/meinberlin/apps/livequestions/dashboard.py#L15 The last bit should go, so that it is True, when it is in the right module, but the module doesn't need to be published.
oh danke darling, i'll get on that :)


Resolving patch:
diff --git a/meinberlin/apps/livequestions/dashboard.py b/meinberlin/apps/livequestions/dashboard.py
--- a/meinberlin/apps/livequestions/dashboard.py
+++ b/meinberlin/apps/livequestions/dashboard.py
@@ -14,8 +14,7 @@ class LiveStreamComponent(DashboardComponent):
 
     def is_effective(self, module):
         module_app = module.phases[0].content().app
-        return (module_app == 'meinberlin_livequestions' and
-                not module.project.is_draft)
+        return (module_app == 'meinberlin_livequestions')
 
     def get_progress(self, module):
         return 0, 0


Test patch: