aboutsummaryrefslogtreecommitdiffstats
path: root/servo/models
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2015-09-29 00:24:27 +0300
committerFilipp Lepalaan <filipp@mac.com>2015-09-29 00:24:27 +0300
commit396a3458eda07858b1142477666e8af134a00db3 (patch)
tree21d41c2ad44d986d85cb3121a4bb3f0262284a1a /servo/models
parenta3f0cd1123f78620dcdd7bc4a9e850f41dfc4ca3 (diff)
downloadServo-396a3458eda07858b1142477666e8af134a00db3.tar.gz
Servo-396a3458eda07858b1142477666e8af134a00db3.tar.bz2
Servo-396a3458eda07858b1142477666e8af134a00db3.zip
Cleanup
Diffstat (limited to 'servo/models')
-rw-r--r--servo/models/invoices.py3
-rw-r--r--servo/models/note.py18
2 files changed, 11 insertions, 10 deletions
diff --git a/servo/models/invoices.py b/servo/models/invoices.py
index d88fe60..7fa4287 100644
--- a/servo/models/invoices.py
+++ b/servo/models/invoices.py
@@ -110,7 +110,7 @@ class Invoice(models.Model):
return reverse("invoices-view_invoice", args=[self.pk])
class Meta:
- ordering = ('-id', )
+ ordering = ('-id',)
app_label = 'servo'
get_latest_by = "id"
@@ -177,6 +177,7 @@ def trigger_order_dispatched(sender, instance, created, **kwargs):
description = _(u'Order %s dispatched') % instance.order.code
instance.order.notify('dispatched', description, instance.created_by)
+
@receiver(post_save, sender=Payment)
def trigger_payment_received(sender, instance, created, **kwargs):
if created:
diff --git a/servo/models/note.py b/servo/models/note.py
index da9e08a..28393b0 100644
--- a/servo/models/note.py
+++ b/servo/models/note.py
@@ -419,11 +419,11 @@ class Note(MPTTModel):
sender = location.title
data = urllib.urlencode({
- 'username': settings.SMS_HTTP_USERNAME,
- 'password': settings.SMS_HTTP_PASSWORD,
- 'numberto': recipient.replace(' ', ''),
+ 'username' : settings.SMS_HTTP_USERNAME,
+ 'password' : settings.SMS_HTTP_PASSWORD,
+ 'numberto' : recipient.replace(' ', ''),
'numberfrom': sender.encode(SMS_ENCODING),
- 'message': self.body.encode(SMS_ENCODING),
+ 'message' : self.body.encode(SMS_ENCODING),
})
from ssl import _create_unverified_context
@@ -544,16 +544,16 @@ class Message(models.Model):
sent_at = models.DateTimeField(null=True)
received_at = models.DateTimeField(null=True)
STATUSES = (
- ('SENT', 'SENT'),
+ ('SENT', 'SENT'),
('DELIVERED', 'DELIVERED'),
- ('RECEIVED', 'RECEIVED'),
- ('FAILED', 'FAILED'),
+ ('RECEIVED', 'RECEIVED'),
+ ('FAILED', 'FAILED'),
)
status = models.CharField(max_length=16, choices=STATUSES)
METHODS = (
('EMAIL', 'EMAIL'),
- ('SMS', 'SMS'),
- ('GSX', 'GSX'),
+ ('SMS', 'SMS'),
+ ('GSX', 'GSX'),
)
method = models.CharField(
max_length=16,