forked from 0x2620/pandora
wrap get_frame into transaction to avoid postgres error
This commit is contained in:
parent
f0ea9c17a1
commit
573f034df2
1 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
from django.core.management.base import BaseCommand
|
from django.core.management.base import BaseCommand
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
from django.db import transaction
|
||||||
|
|
||||||
settings.RELOAD_CONFIG = False
|
settings.RELOAD_CONFIG = False
|
||||||
import app.monkey_patch
|
import app.monkey_patch
|
||||||
|
@ -14,7 +15,8 @@ class Command(BaseCommand):
|
||||||
def handle(self, id, height, position, **options):
|
def handle(self, id, height, position, **options):
|
||||||
position = float(position)
|
position = float(position)
|
||||||
height = int(height)
|
height = int(height)
|
||||||
i = models.Item.objects.get(public_id=id)
|
with transaction.commit_on_success():
|
||||||
path = i.frame(position, height)
|
i = models.Item.objects.get(public_id=id)
|
||||||
|
path = i.frame(position, height)
|
||||||
if path:
|
if path:
|
||||||
print path
|
print path
|
||||||
|
|
Loading…
Reference in a new issue