mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
Fix double user creation
This commit is contained in:
parent
29f565f514
commit
bae34c4b1c
@ -29,7 +29,11 @@ class Subscriber(User):
|
|||||||
return s.is_valid_now() if s is not None else False
|
return s.is_valid_now() if s is not None else False
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
|
create = False
|
||||||
|
if not self.id:
|
||||||
|
create = True
|
||||||
super(Subscriber, self).save()
|
super(Subscriber, self).save()
|
||||||
|
if create:
|
||||||
try: # Create user on the old site: TODO remove me!
|
try: # Create user on the old site: TODO remove me!
|
||||||
db = MySQLdb.connect(**settings.OLD_MYSQL_INFOS)
|
db = MySQLdb.connect(**settings.OLD_MYSQL_INFOS)
|
||||||
c = db.cursor()
|
c = db.cursor()
|
||||||
|
Loading…
Reference in New Issue
Block a user