Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Commit

Permalink
Make sure to use master database only for sequence generation. Bug 66…
Browse files Browse the repository at this point in the history
…2830.
  • Loading branch information
Fred Wenzel committed Jun 8, 2011
1 parent 386df65 commit fa30230
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ffdemo/markup/common.py
Expand Up @@ -3,7 +3,7 @@
import re
import bcrypt

from django.db import connection
from django.db import connections

from ffdemo.markup.models import Mark
from ffdemo.markup.models import Invitation
Expand Down Expand Up @@ -115,7 +115,7 @@ def generate_reference():

# This is some raw SQL to keep things atomic. Straight from the MySQL docs:
# http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_last-insert-id
cursor = connection.cursor()
cursor = connections['default'].cursor()
cursor.execute("""UPDATE markup_marksequence SET
id=LAST_INSERT_ID(id + 1)""")

Expand Down

0 comments on commit fa30230

Please sign in to comment.