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
|
||||
|
||||
|
||||
class ServiceAccount(models.Model):
|
||||
"""
|
||||
ServiceAccount represents the user's account on a Service.
|
||||
@@ -239,7 +240,7 @@ class ServiceAccount(models.Model):
|
||||
break
|
||||
|
||||
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:
|
||||
raise ServiceError('Error occured while trying to create the Service Account, please try again later')
|
||||
else:
|
||||
|
||||
@@ -49,8 +49,7 @@ class MiningBuddyService(BaseDBService):
|
||||
self.db.connection.commit()
|
||||
|
||||
userid = self.dbcursor.lastrowid
|
||||
if 'eveapi' in kwargs:
|
||||
self.dbcursor.execute(self.SQL_ADD_API, [userid, int(time.time()), kwargs['eveapi'].api_user_id, kwargs['eveapi'].api_key, kwargs['character'].id])
|
||||
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.db.connection.commit()
|
||||
|
||||
return { 'username': self._clean_username(username), 'password': password }
|
||||
|
||||
@@ -34,11 +34,7 @@ class POSTrackerService(BaseDBService):
|
||||
""" Add a user """
|
||||
email = kwargs['user'].email
|
||||
pwhash, salt = self._gen_pwhash(password)
|
||||
|
||||
if 'eveapi' in kwargs:
|
||||
eveid = kwargs['eveapi'].api_user_id
|
||||
else:
|
||||
eveid = None
|
||||
eveid = kwargs['character'].eveaccount.api_user_id
|
||||
|
||||
self.dbcursor.execute(self.SQL_ADD_USER, [eveid, username, "%s%s" % (salt, pwhash) , email])
|
||||
self.db.connection.commit()
|
||||
|
||||
Reference in New Issue
Block a user