# HG changeset patch # User raph # Date 1280851295 -7200 # Node ID df2c3202fd8ec601813410e783008d2bb6783132 # Parent 19f313576d4415d514110f2151349d15a118de01 do not lock table with backends other than postgresql (postgresql specific syntax) (fixes #52) diff -r 19f313576d44 -r df2c3202fd8e src/cm/models.py --- a/src/cm/models.py Tue Aug 03 16:42:05 2010 +0200 +++ b/src/cm/models.py Tue Aug 03 18:01:35 2010 +0200 @@ -600,10 +600,11 @@ def create_inactive_user(self, email, send_invitation, **kwargs): - #prevent concurrent access - cursor = connection.cursor() - sql = "LOCK TABLE auth_user IN EXCLUSIVE MODE" - cursor.execute(sql) + if 'postgresql' in settings.DATABASE_ENGINE: + #prevent concurrent access + cursor = connection.cursor() + sql = "LOCK TABLE auth_user IN EXCLUSIVE MODE" + cursor.execute(sql) try: user_with_email = User.objects.get(email__iexact=email) diff -r 19f313576d44 -r df2c3202fd8e src/cm/tests/__init__.py --- a/src/cm/tests/__init__.py Tue Aug 03 16:42:05 2010 +0200 +++ b/src/cm/tests/__init__.py Tue Aug 03 18:01:35 2010 +0200 @@ -6,4 +6,5 @@ from cm.tests.test_history import * from cm.tests.test_security import * from cm.tests.test_activity import * +from cm.tests.test_registration import * from cm.tests.test_api import * diff -r 19f313576d44 -r df2c3202fd8e src/cm/tests/test_registration.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/cm/tests/test_registration.py Tue Aug 03 18:01:35 2010 +0200 @@ -0,0 +1,16 @@ +from django.test import TestCase +from django.test.client import Client +from django.core import management + + +from cm.models import * +from cm.security import * +from cm.tests.test_comment_positioning import create_comment + + +class RegistrationTest(TestCase): + fixtures = ['roles_generic','test_content'] + + def test_registration(self): + user = UserProfile.objects.create_inactive_user('no@noreply', False) + \ No newline at end of file