prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Make private project setting more clear
  Currently the checkbox is kind of hidden and it is not instantly clear what is meant by "Access to Project". The setting should be more obvious and it's consequences more clear.
  
  Opin has another way of showing the setting which we could/should adopt
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `meinberlin/apps/dashboard2/forms.py`
  Content:
  ```
  1 from django import forms
  2 from django.contrib.auth import get_user_model
  3 from django.forms import inlineformset_factory
  4 from django.utils.translation import ugettext_lazy as _
  5 
  6 from adhocracy4.categories import models as category_models
  7 from adhocracy4.forms.fields import DateTimeField
  8 from adhocracy4.maps import models as map_models
  9 from adhocracy4.modules import models as module_models
  10 from adhocracy4.phases import models as phase_models
  11 from adhocracy4.projects import models as project_models
  12 from meinberlin.apps.maps.widgets import MapChoosePolygonWithPresetWidget
  13 
  14 from . import signals
  15 from .components.forms import ModuleDashboardForm
  16 from .components.forms import ModuleDashboardFormSet
  17 from .components.forms import ProjectDashboardForm
  18 
  19 User = get_user_model()
  20 
  21 
  22 class ProjectCreateForm(forms.ModelForm):
  23 
  24     class Meta:
  25         model = project_models.Project
  26         fields = ['name', 'description', 'image', 'image_copyright']
  27 
  28     def __init__(self, organisation, creator,
  29                  *args, **kwargs):
  30         super().__init__(*args, **kwargs)
  31         self.organisation = organisation
  32         self.creator = creator
  33 
  34     def save(self, commit=True):
  35         project = super().save(commit=False)
  36 
  37         project.organisation = self.organisation
  38         project.creator = self.creator
  39 
  40         if commit:
  41             project.save()
  42             if hasattr(self, 'save_m2m'):
  43                 self.save_m2m()
  44 
  45         return project
  46 
  47 
  48 class ProjectBasicForm(ProjectDashboardForm):
  49 
  50     class Meta:
  51         model = project_models.Project
  52         fields = ['name', 'description', 'image', 'image_copyright',
  53                   'tile_image', 'tile_image_copyright',
  54                   'is_archived', 'is_public']
  55         required_for_project_publish = ['name', 'description']
  56 
  57     def __init__(self, *args, **kwargs):
  58         super().__init__(*args, **kwargs)
  59         instance = kwargs.get('instance', None)
  60         self._project_was_archived = instance and instance.is_archived
  61 
  62     def save(self, commit=True):
  63         project = super().save(commit)
  64         if not self._project_was_archived and project.is_archived:
  65             signals.project_archived.send(sender=None, project=project)
  66         return project
  67 
  68 
  69 class ProjectInformationForm(ProjectDashboardForm):
  70 
  71     class Meta:
  72         model = project_models.Project
  73         fields = ['information']
  74         required_for_project_publish = ['information']
  75 
  76 
  77 class ProjectResultForm(ProjectDashboardForm):
  78 
  79     class Meta:
  80         model = project_models.Project
  81         fields = ['result']
  82         required_for_project_publish = []
  83 
  84 
  85 class ModuleBasicForm(ModuleDashboardForm):
  86 
  87     class Meta:
  88         model = module_models.Module
  89         fields = ['name', 'description']
  90         required_for_project_publish = '__all__'
  91 
  92 
  93 class PhaseForm(forms.ModelForm):
  94     end_date = DateTimeField(
  95         time_format='%H:%M',
  96         required=False,
  97         require_all_fields=False,
  98         label=(_('End date'), _('End time'))
  99     )
  100     start_date = DateTimeField(
  101         time_format='%H:%M',
  102         required=False,
  103         require_all_fields=False,
  104         label=(_('Start date'), _('Start time'))
  105     )
  106 
  107     class Meta:
  108         model = phase_models.Phase
  109         fields = ['name', 'description', 'start_date', 'end_date',
  110                   'type',  # required for get_phase_name in the tpl
  111                   ]
  112         required_for_project_publish = ['name', 'description', 'start_date',
  113                                         'end_date']
  114         widgets = {
  115             'type': forms.HiddenInput(),
  116             'weight': forms.HiddenInput()
  117         }
  118 
  119 
  120 PhaseFormSet = inlineformset_factory(module_models.Module,
  121                                      phase_models.Phase,
  122                                      form=PhaseForm,
  123                                      formset=ModuleDashboardFormSet,
  124                                      extra=0,
  125                                      can_delete=False,
  126                                      )
  127 
  128 
  129 class AreaSettingsForm(ModuleDashboardForm):
  130 
  131     def __init__(self, *args, **kwargs):
  132         self.module = kwargs['instance']
  133         kwargs['instance'] = self.module.settings_instance
  134         super().__init__(*args, **kwargs)
  135 
  136     def save(self, commit=True):
  137         super().save(commit)
  138         return self.module
  139 
  140     def get_project(self):
  141         return self.module.project
  142 
  143     class Meta:
  144         model = map_models.AreaSettings
  145         fields = ['polygon']
  146         required_for_project_publish = ['polygon']
  147         # widgets = map_models.AreaSettings.widgets()
  148         widgets = {'polygon': MapChoosePolygonWithPresetWidget}
  149 
  150 
  151 class CategoryForm(forms.ModelForm):
  152     name = forms.CharField(widget=forms.TextInput(attrs={
  153         'placeholder': _('Category')}
  154     ))
  155 
  156     @property
  157     def media(self):
  158         media = super().media
  159         media.add_js(['js/formset.js'])
  160         return media
  161 
  162     class Meta:
  163         model = category_models.Category
  164         fields = ['name']
  165 
  166 
  167 CategoryFormSet = inlineformset_factory(module_models.Module,
  168                                         category_models.Category,
  169                                         form=CategoryForm,
  170                                         formset=ModuleDashboardFormSet,
  171                                         extra=0,
  172                                         )
  173
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/meinberlin/apps/dashboard2/forms.py b/meinberlin/apps/dashboard2/forms.py
  --- a/meinberlin/apps/dashboard2/forms.py
  +++ b/meinberlin/apps/dashboard2/forms.py
  @@ -1,5 +1,6 @@
   from django import forms
   from django.contrib.auth import get_user_model
  +from django.forms import RadioSelect
   from django.forms import inlineformset_factory
   from django.utils.translation import ugettext_lazy as _
   
  @@ -53,6 +54,14 @@
                     'tile_image', 'tile_image_copyright',
                     'is_archived', 'is_public']
           required_for_project_publish = ['name', 'description']
  +        widgets = {
  +            'is_public': RadioSelect(
  +                choices=[
  +                    (True, _('All users can participate (public).')),
  +                    (False, _('Only invited users can participate (private).'))
  +                ]
  +            ),
  +        }
   
       def __init__(self, *args, **kwargs):
           super().__init__(*args, **kwargs)
  
verification_info: {"golden_diff": "diff --git a/meinberlin/apps/dashboard2/forms.py b/meinberlin/apps/dashboard2/forms.py\n--- a/meinberlin/apps/dashboard2/forms.py\n+++ b/meinberlin/apps/dashboard2/forms.py\n@@ -1,5 +1,6 @@\n from django import forms\n from django.contrib.auth import get_user_model\n+from django.forms import RadioSelect\n from django.forms import inlineformset_factory\n from django.utils.translation import ugettext_lazy as _\n \n@@ -53,6 +54,14 @@\n                   'tile_image', 'tile_image_copyright',\n                   'is_archived', 'is_public']\n         required_for_project_publish = ['name', 'description']\n+        widgets = {\n+            'is_public': RadioSelect(\n+                choices=[\n+                    (True, _('All users can participate (public).')),\n+                    (False, _('Only invited users can participate (private).'))\n+                ]\n+            ),\n+        }\n \n     def __init__(self, *args, **kwargs):\n         super().__init__(*args, **kwargs)\n", "issue": "Make private project setting more clear\nCurrently the checkbox is kind of hidden and it is not instantly clear what is meant by \"Access to Project\". The setting should be more obvious and it's consequences more clear.\r\n\r\nOpin has another way of showing the setting which we could/should adopt\n", "before_files": [{"content": "from django import forms\nfrom django.contrib.auth import get_user_model\nfrom django.forms import inlineformset_factory\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom adhocracy4.categories import models as category_models\nfrom adhocracy4.forms.fields import DateTimeField\nfrom adhocracy4.maps import models as map_models\nfrom adhocracy4.modules import models as module_models\nfrom adhocracy4.phases import models as phase_models\nfrom adhocracy4.projects import models as project_models\nfrom meinberlin.apps.maps.widgets import MapChoosePolygonWithPresetWidget\n\nfrom . import signals\nfrom .components.forms import ModuleDashboardForm\nfrom .components.forms import ModuleDashboardFormSet\nfrom .components.forms import ProjectDashboardForm\n\nUser = get_user_model()\n\n\nclass ProjectCreateForm(forms.ModelForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['name', 'description', 'image', 'image_copyright']\n\n    def __init__(self, organisation, creator,\n                 *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.organisation = organisation\n        self.creator = creator\n\n    def save(self, commit=True):\n        project = super().save(commit=False)\n\n        project.organisation = self.organisation\n        project.creator = self.creator\n\n        if commit:\n            project.save()\n            if hasattr(self, 'save_m2m'):\n                self.save_m2m()\n\n        return project\n\n\nclass ProjectBasicForm(ProjectDashboardForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['name', 'description', 'image', 'image_copyright',\n                  'tile_image', 'tile_image_copyright',\n                  'is_archived', 'is_public']\n        required_for_project_publish = ['name', 'description']\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        instance = kwargs.get('instance', None)\n        self._project_was_archived = instance and instance.is_archived\n\n    def save(self, commit=True):\n        project = super().save(commit)\n        if not self._project_was_archived and project.is_archived:\n            signals.project_archived.send(sender=None, project=project)\n        return project\n\n\nclass ProjectInformationForm(ProjectDashboardForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['information']\n        required_for_project_publish = ['information']\n\n\nclass ProjectResultForm(ProjectDashboardForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['result']\n        required_for_project_publish = []\n\n\nclass ModuleBasicForm(ModuleDashboardForm):\n\n    class Meta:\n        model = module_models.Module\n        fields = ['name', 'description']\n        required_for_project_publish = '__all__'\n\n\nclass PhaseForm(forms.ModelForm):\n    end_date = DateTimeField(\n        time_format='%H:%M',\n        required=False,\n        require_all_fields=False,\n        label=(_('End date'), _('End time'))\n    )\n    start_date = DateTimeField(\n        time_format='%H:%M',\n        required=False,\n        require_all_fields=False,\n        label=(_('Start date'), _('Start time'))\n    )\n\n    class Meta:\n        model = phase_models.Phase\n        fields = ['name', 'description', 'start_date', 'end_date',\n                  'type',  # required for get_phase_name in the tpl\n                  ]\n        required_for_project_publish = ['name', 'description', 'start_date',\n                                        'end_date']\n        widgets = {\n            'type': forms.HiddenInput(),\n            'weight': forms.HiddenInput()\n        }\n\n\nPhaseFormSet = inlineformset_factory(module_models.Module,\n                                     phase_models.Phase,\n                                     form=PhaseForm,\n                                     formset=ModuleDashboardFormSet,\n                                     extra=0,\n                                     can_delete=False,\n                                     )\n\n\nclass AreaSettingsForm(ModuleDashboardForm):\n\n    def __init__(self, *args, **kwargs):\n        self.module = kwargs['instance']\n        kwargs['instance'] = self.module.settings_instance\n        super().__init__(*args, **kwargs)\n\n    def save(self, commit=True):\n        super().save(commit)\n        return self.module\n\n    def get_project(self):\n        return self.module.project\n\n    class Meta:\n        model = map_models.AreaSettings\n        fields = ['polygon']\n        required_for_project_publish = ['polygon']\n        # widgets = map_models.AreaSettings.widgets()\n        widgets = {'polygon': MapChoosePolygonWithPresetWidget}\n\n\nclass CategoryForm(forms.ModelForm):\n    name = forms.CharField(widget=forms.TextInput(attrs={\n        'placeholder': _('Category')}\n    ))\n\n    @property\n    def media(self):\n        media = super().media\n        media.add_js(['js/formset.js'])\n        return media\n\n    class Meta:\n        model = category_models.Category\n        fields = ['name']\n\n\nCategoryFormSet = inlineformset_factory(module_models.Module,\n                                        category_models.Category,\n                                        form=CategoryForm,\n                                        formset=ModuleDashboardFormSet,\n                                        extra=0,\n                                        )\n", "path": "meinberlin/apps/dashboard2/forms.py"}], "after_files": [{"content": "from django import forms\nfrom django.contrib.auth import get_user_model\nfrom django.forms import RadioSelect\nfrom django.forms import inlineformset_factory\nfrom django.utils.translation import ugettext_lazy as _\n\nfrom adhocracy4.categories import models as category_models\nfrom adhocracy4.forms.fields import DateTimeField\nfrom adhocracy4.maps import models as map_models\nfrom adhocracy4.modules import models as module_models\nfrom adhocracy4.phases import models as phase_models\nfrom adhocracy4.projects import models as project_models\nfrom meinberlin.apps.maps.widgets import MapChoosePolygonWithPresetWidget\n\nfrom . import signals\nfrom .components.forms import ModuleDashboardForm\nfrom .components.forms import ModuleDashboardFormSet\nfrom .components.forms import ProjectDashboardForm\n\nUser = get_user_model()\n\n\nclass ProjectCreateForm(forms.ModelForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['name', 'description', 'image', 'image_copyright']\n\n    def __init__(self, organisation, creator,\n                 *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        self.organisation = organisation\n        self.creator = creator\n\n    def save(self, commit=True):\n        project = super().save(commit=False)\n\n        project.organisation = self.organisation\n        project.creator = self.creator\n\n        if commit:\n            project.save()\n            if hasattr(self, 'save_m2m'):\n                self.save_m2m()\n\n        return project\n\n\nclass ProjectBasicForm(ProjectDashboardForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['name', 'description', 'image', 'image_copyright',\n                  'tile_image', 'tile_image_copyright',\n                  'is_archived', 'is_public']\n        required_for_project_publish = ['name', 'description']\n        widgets = {\n            'is_public': RadioSelect(\n                choices=[\n                    (True, _('All users can participate (public).')),\n                    (False, _('Only invited users can participate (private).'))\n                ]\n            ),\n        }\n\n    def __init__(self, *args, **kwargs):\n        super().__init__(*args, **kwargs)\n        instance = kwargs.get('instance', None)\n        self._project_was_archived = instance and instance.is_archived\n\n    def save(self, commit=True):\n        project = super().save(commit)\n        if not self._project_was_archived and project.is_archived:\n            signals.project_archived.send(sender=None, project=project)\n        return project\n\n\nclass ProjectInformationForm(ProjectDashboardForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['information']\n        required_for_project_publish = ['information']\n\n\nclass ProjectResultForm(ProjectDashboardForm):\n\n    class Meta:\n        model = project_models.Project\n        fields = ['result']\n        required_for_project_publish = []\n\n\nclass ModuleBasicForm(ModuleDashboardForm):\n\n    class Meta:\n        model = module_models.Module\n        fields = ['name', 'description']\n        required_for_project_publish = '__all__'\n\n\nclass PhaseForm(forms.ModelForm):\n    end_date = DateTimeField(\n        time_format='%H:%M',\n        required=False,\n        require_all_fields=False,\n        label=(_('End date'), _('End time'))\n    )\n    start_date = DateTimeField(\n        time_format='%H:%M',\n        required=False,\n        require_all_fields=False,\n        label=(_('Start date'), _('Start time'))\n    )\n\n    class Meta:\n        model = phase_models.Phase\n        fields = ['name', 'description', 'start_date', 'end_date',\n                  'type',  # required for get_phase_name in the tpl\n                  ]\n        required_for_project_publish = ['name', 'description', 'start_date',\n                                        'end_date']\n        widgets = {\n            'type': forms.HiddenInput(),\n            'weight': forms.HiddenInput()\n        }\n\n\nPhaseFormSet = inlineformset_factory(module_models.Module,\n                                     phase_models.Phase,\n                                     form=PhaseForm,\n                                     formset=ModuleDashboardFormSet,\n                                     extra=0,\n                                     can_delete=False,\n                                     )\n\n\nclass AreaSettingsForm(ModuleDashboardForm):\n\n    def __init__(self, *args, **kwargs):\n        self.module = kwargs['instance']\n        kwargs['instance'] = self.module.settings_instance\n        super().__init__(*args, **kwargs)\n\n    def save(self, commit=True):\n        super().save(commit)\n        return self.module\n\n    def get_project(self):\n        return self.module.project\n\n    class Meta:\n        model = map_models.AreaSettings\n        fields = ['polygon']\n        required_for_project_publish = ['polygon']\n        # widgets = map_models.AreaSettings.widgets()\n        widgets = {'polygon': MapChoosePolygonWithPresetWidget}\n\n\nclass CategoryForm(forms.ModelForm):\n    name = forms.CharField(widget=forms.TextInput(attrs={\n        'placeholder': _('Category')}\n    ))\n\n    @property\n    def media(self):\n        media = super().media\n        media.add_js(['js/formset.js'])\n        return media\n\n    class Meta:\n        model = category_models.Category\n        fields = ['name']\n\n\nCategoryFormSet = inlineformset_factory(module_models.Module,\n                                        category_models.Category,\n                                        form=CategoryForm,\n                                        formset=ModuleDashboardFormSet,\n                                        extra=0,\n                                        )\n", "path": "meinberlin/apps/dashboard2/forms.py"}]}