mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Remove eveapi/reddit from add_user call, all is accessible by user/char
This commit is contained in:
@@ -194,6 +194,7 @@ class Service(models.Model):
|
|||||||
|
|
||||||
return setdict
|
return setdict
|
||||||
|
|
||||||
|
|
||||||
class ServiceAccount(models.Model):
|
class ServiceAccount(models.Model):
|
||||||
"""
|
"""
|
||||||
ServiceAccount represents the user's account on a Service.
|
ServiceAccount represents the user's account on a Service.
|
||||||
@@ -239,7 +240,7 @@ class ServiceAccount(models.Model):
|
|||||||
break
|
break
|
||||||
|
|
||||||
reddit = RedditAccount.objects.filter(user=self.user)
|
reddit = RedditAccount.objects.filter(user=self.user)
|
||||||
d = api.add_user(self.username, self.password, user=self.user, character=self.character, eveapi=eveapi, reddit=reddit)
|
d = api.add_user(self.username, self.password, user=self.user, character=self.character)
|
||||||
if not d:
|
if not d:
|
||||||
raise ServiceError('Error occured while trying to create the Service Account, please try again later')
|
raise ServiceError('Error occured while trying to create the Service Account, please try again later')
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -49,9 +49,8 @@ class MiningBuddyService(BaseDBService):
|
|||||||
self.db.connection.commit()
|
self.db.connection.commit()
|
||||||
|
|
||||||
userid = self.dbcursor.lastrowid
|
userid = self.dbcursor.lastrowid
|
||||||
if 'eveapi' in kwargs:
|
self.dbcursor.execute(self.SQL_ADD_API, [userid, int(time.time()), kwargs['character'].eveaccount.api_user_id, kwargs['character'].eveaccount.api_key, kwargs['character'].id])
|
||||||
self.dbcursor.execute(self.SQL_ADD_API, [userid, int(time.time()), kwargs['eveapi'].api_user_id, kwargs['eveapi'].api_key, kwargs['character'].id])
|
self.db.connection.commit()
|
||||||
self.db.connection.commit()
|
|
||||||
|
|
||||||
return { 'username': self._clean_username(username), 'password': password }
|
return { 'username': self._clean_username(username), 'password': password }
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,7 @@ class POSTrackerService(BaseDBService):
|
|||||||
""" Add a user """
|
""" Add a user """
|
||||||
email = kwargs['user'].email
|
email = kwargs['user'].email
|
||||||
pwhash, salt = self._gen_pwhash(password)
|
pwhash, salt = self._gen_pwhash(password)
|
||||||
|
eveid = kwargs['character'].eveaccount.api_user_id
|
||||||
if 'eveapi' in kwargs:
|
|
||||||
eveid = kwargs['eveapi'].api_user_id
|
|
||||||
else:
|
|
||||||
eveid = None
|
|
||||||
|
|
||||||
self.dbcursor.execute(self.SQL_ADD_USER, [eveid, username, "%s%s" % (salt, pwhash) , email])
|
self.dbcursor.execute(self.SQL_ADD_USER, [eveid, username, "%s%s" % (salt, pwhash) , email])
|
||||||
self.db.connection.commit()
|
self.db.connection.commit()
|
||||||
|
|||||||
Reference in New Issue
Block a user