Browse files

Registered models to django-revision and added middleware

  • Loading branch information...
1 parent b8a1fc5 commit df2184b3b4c8dcd56dc6d05703c98c733f1c62aa @anttihirvonen committed Sep 14, 2012
View
5 dotmembership/apps/billing/models.py
@@ -3,7 +3,8 @@
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils.translation import ugettext_lazy as _
-from django.core.exceptions import ValidationError
+
+import reversion
from model_utils import Choices
from datetime import timedelta, date
@@ -49,6 +50,8 @@ def save(self, *args, **kwargs):
def __unicode__(self):
return "{0}, {1}".format(self.member, self.for_year)
+reversion.register(Invoice)
+
@receiver(post_save, sender=Invoice)
def calculate_reference_number(sender, instance, created, **kwargs):
View
4 dotmembership/apps/members/models.py
@@ -10,6 +10,8 @@
from django.contrib.sites.models import Site
from django.conf import settings
+import reversion
+
from model_utils import Choices
@@ -75,6 +77,8 @@ class Meta:
verbose_name = _(u"jäsen")
verbose_name_plural = _(u"jäsenet")
+reversion.register(Member)
+
@receiver(post_save, sender=Member, dispatch_uid="member.create_invoice_send_welcome_mail")
def create_first_invoice_and_send_welcome_email(sender, instance, created, **kwargs):
View
2 dotmembership/apps/members/templates/members/confirm_email_success.html
@@ -5,7 +5,7 @@
<div class="row">
<div class="span12">
<h3>Sähköpostiosoitteesi vaihdettiin</h3>
- <p>Sähköpostiosoitteesi on nyt vaihdettu osoitteeseen <b>{{ member.email }}</b>. Vanha osoitteesi oli {{ old.email }}.</p>
+ <p>Sähköpostiosoitteesi on nyt vaihdettu osoitteeseen <b>{{ member.email }}</b>.</p>
<p>Jatkossa sinun tulee käyttää uutta osoitetta, mikäli haluat muokata jäsentietojasi.</p>
</div>
</div>
View
2 dotmembership/settings/base.py
@@ -81,6 +81,8 @@
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
+ 'django.middleware.transaction.TransactionMiddleware',
+ 'reversion.middleware.RevisionMiddleware',
# Uncomment the next line for simple clickjacking protection:
# 'django.middleware.clickjacking.XFrameOptionsMiddleware',
)

0 comments on commit df2184b

Please sign in to comment.