Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

commit_on_success -> atomic, for 1.8, as commit_on_success was removed #58

Merged
merged 1 commit into from
Apr 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions silk/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def bulk_create(self, *args, **kwargs):
objs = args[0]
else:
objs = kwargs.get('objs')
with transaction.commit_on_success():
with transaction.atomic():
request_counter = Counter([x.request_id for x in objs])
requests = Request.objects.filter(pk__in=request_counter.keys())
# TODO: Not that there is ever more than one request (but there could be eventually)
Expand Down Expand Up @@ -184,7 +184,7 @@ def tables_involved(self):
pass
return tables

@transaction.commit_on_success()
@transaction.atomic()
def save(self, *args, **kwargs):
if self.end_time and self.start_time:
interval = self.end_time - self.start_time
Expand All @@ -195,7 +195,7 @@ def save(self, *args, **kwargs):
self.request.save()
super(SQLQuery, self).save(*args, **kwargs)

@transaction.commit_on_success()
@transaction.atomic()
def delete(self, *args, **kwargs):
self.request.num_sql_queries -= 1
self.request.save()
Expand Down