Add notifications for membership changes.
This commit is contained in:
parent
673c194967
commit
9c19785a12
|
@ -7,7 +7,7 @@
|
|||
Pop in and say hi, please wait around our users tend to idle, some one will likely respond given a chance.
|
||||
</p>
|
||||
<p>
|
||||
<a href="https://riot.im/app/#/room/#maidstone-hackspace:matrix.org">Full screen Chat</a> or grab one of the <a target="_blank" href="https://matrix.org/docs/projects/try-matrix-now.html">mobile apps.
|
||||
<a href="https://riot.im/app/#/room/#maidstone-hackspace:matrix.org">Full screen Chat</a> or grab one of the <a target="_blank" href="https://matrix.org/docs/projects/try-matrix-now.html">mobile apps for Android and Apple phones.</a>
|
||||
</p>
|
||||
|
||||
<iframe src="https://riot.im/app/#/room/#maidstone-hackspace:matrix.org" style="width:100%;height:600px;"></iframe>
|
||||
|
@ -18,6 +18,5 @@
|
|||
<p>
|
||||
Connect directly using irc.freenode.org and the #maidstone-hackspace channel via an irc client.
|
||||
</p>
|
||||
<a href="https://hangouts.google.com/group/oDcAL0nDfQYfO3qq1">Alternatively join us on our legacy Hangouts chat</a>
|
||||
|
||||
{% endblock content %}
|
||||
|
|
|
@ -117,3 +117,14 @@ class Rfid(models.Model):
|
|||
|
||||
def name(self):
|
||||
return self.user.name
|
||||
|
||||
|
||||
def send_subscription_update_message(sender, instance, **kwargs):
|
||||
matrix_message.delay(
|
||||
prefix=' - MEMBERSHIP',
|
||||
message='Changed to %s for user %s' % (
|
||||
instance.get_status,
|
||||
instance.user.username))
|
||||
|
||||
|
||||
post_save.connect(send_subscription_update_message, sender=Membership)
|
||||
|
|
Loading…
Reference in New Issue