Merge branch 'production'
authorMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 15 Jun 2009 10:01:42 +0000 (12:01 +0200)
committerMatthijs Kooijman <m.kooijman@student.utwente.nl>
Mon, 15 Jun 2009 10:01:42 +0000 (12:01 +0200)
* production:
  Remove SQL password from import.py.
  Add code to support disabling new influences.
  Remove \r's.
  Only notify a player of finished influence changes.

1  2 
influences/notify.py
templates/influences/influence_detail.html

index d53ab36a51a9dd6377ec85c487ac62e68a3a6aac,daffadf5cb4a53aa42a3967ce5c394eb3ddaa9fe..6aae6f28bb0cfb5548032d7cddc4f5566d38f97f
@@@ -17,10 -17,10 +17,12 @@@ signals.post_save.connect(character_sav
  def influence_saved(**kwargs):
      instance = kwargs['instance']
      created  = kwargs['created']
 +    recipients = ['lextalionis@evolution-events.nl']
 +    recipients.extend(instance.related_players.keys())
      if (not settings.DEBUG):
-         # TODO: Perhaps only notify when the status is / becomes Done?
+         recipients = ['lextalionis@evolution-events.nl']
+         if instance.status == 'D':
+             recipients.append(instance.character.player)
          notify(recipients, 'influences/email/influence_changed.html', {'influence' : instance, 'created' : created})
  
  signals.post_save.connect(influence_saved, sender=Influence)
index 5c50b67dce014a8f93495304535d1933d5f155b6,8bddb9cd16b4a7b6972542b0b26a2ca80770edc1..12ec468123e38525ad3d169f6a97f3b9e498ad68
  {% endif %}
  </table>
  <p>{{ object.description }}</p>
 +{# Show all related players, except for the current user #}
 +{% with object.related_players|remove_item:user as players %}
 +    {% if players %}
 +    {% trans "Note: This influence (and its comments) can also be viewed by:" %}
 +    <ul>
 +        {% for player, chars in players.items %}
 +            <li>{{ player }} ({% trans "player of" %} {{ chars|natural_list }})</li>
 +        {% endfor %}
 +    </ul>
 +    {% endif %}
 +{% endwith %}
+ {% if object.result %}
+ <h2>{% trans "Result" %}</h2>
+ <p>{{ object.result }}</p>
+ {% endif %}
  <h2>{% trans "Comments" %}</h2>
  {% block comments %}
  {% include "influences/influence_comments_block.html" %}