Repository: liqd/a4-meinberlin

Issue:
moderators for b-plans
if an initiator starts a b-plan via meinBerlin (as e.g. SenWohn does, they don't have imperia) or an external project he/she is automatically added as moderator and gets mails as the one below. This is confusing because:
a) you don't see moderators in dashboard
b) you can't follow a b-plan/external project
c) the link does not go to the external page (in this case it goes here: https://mein.berlin.de/projects/bebauungsplan-8-66-buckower-felder/)

Should we take out this rule for these two templates or stop sending mails?


<img width="698" alt="bildschirmfoto 2019-02-04 um 13 32 08" src="https://user-images.githubusercontent.com/35491681/52208589-762c0780-2881-11e9-9781-21826347abe4.png">



Discussion:
@CarolingerSeilchenspringer have you decided what you would like to do about this? is it still an issue? we have done quite a bit on the emails since then
@phillimorland this is still an issue and still confusing. Initiators may think that this is what users get although this mail does not exist for bplans and external projects. is it complicated to just stop this mail only for bplans? I tested for external projects and did not get a mail, wouldn't that be the same?
@phillimorland have to correct my above statement: for external projects the mail is also send to the initiator.
@CarolingerSeilchenspringer There shouldn't be any mails about bplans, external projects, or project containers, right? So, we can only send the emails for proper a4-projects. Would that be alright?
@fuzzylogic2000 I guess so.  There should still be the mail you get as initiator informing you that there is a new project in your organisation if bplan/external/container is being created. But no "follow" mails (start/end/event/newsletter). For bplans we still have the three mails that were recently (re)done (new statement/your statement/changed in bplan). If helpful check out the mail overview in our wiki.
@Rineee I will unassign myself again here, in case you get here first. :)
@Rineee Can we talk about this tomorrow?
There are at least three places where we could add something preventing the emails from getting sent. And I don't really like any of them.

- We could prevent the creators becoming moderators for any other project type than a4projects.Projects here: https://github.com/liqd/adhocracy4/blob/322a7ebd6c87195c23ff2479e90ae726273114c2/adhocracy4/dashboard/forms.py#L56 But That is in a4 and very special to mB. If we ever also inherit from the a4-Project anywhere else, why shouldn't we also add whoever saved it as a moderator? (Also I am not sure, the project already has a project type here. Most likely has, but still.)
- We could make sure in the send notification function, that they are only sent for a4projects.Projects. https://github.com/liqd/a4-meinberlin/blob/70b50793b5c0b14a929a5eab64b6b47238338794/meinberlin/apps/notifications/signals.py#L17
- We could also empty the receivers list in the email: https://github.com/liqd/a4-meinberlin/blob/70b50793b5c0b14a929a5eab64b6b47238338794/meinberlin/apps/notifications/emails.py#L97

Resolving patch:
diff --git a/meinberlin/apps/notifications/signals.py b/meinberlin/apps/notifications/signals.py
--- a/meinberlin/apps/notifications/signals.py
+++ b/meinberlin/apps/notifications/signals.py
@@ -25,7 +25,8 @@ def send_notifications(instance, created, **kwargs):
         if action.project:
             emails.NotifyModeratorsEmail.send(action)
 
-    elif action.type == 'phase':
+    elif (action.type == 'phase' and
+          action.project.project_type == 'a4projects.Project'):
         if verb == Verbs.START:
             emails.NotifyFollowersOnPhaseStartedEmail.send(action)
         elif verb == Verbs.SCHEDULE:


Test patch: