mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-07 07:36:20 +01:00
Changed discord account handling. Now requests email and password and grabs UID via API.
UID is stored in authserviceinfo model and used as required.
This commit is contained in:
@@ -81,9 +81,8 @@ class AuthServicesInfoManager:
|
||||
authserviceinfo.save(update_fields=['is_blue'])
|
||||
|
||||
@staticmethod
|
||||
def update_user_discord_info(username, password, user):
|
||||
def update_user_discord_info(user_id, user):
|
||||
if User.objects.filter(username=user.username).exists():
|
||||
authserviceinfo = AuthServicesInfoManager.__get_or_create(user)
|
||||
authserviceinfo.discord_username = username
|
||||
authserviceinfo.discord_password = password
|
||||
authserviceinfo.save(update_fields=['discord_username', 'discord_password'])
|
||||
authserviceinfo.discord_uid = user_id
|
||||
authserviceinfo.save(update_fields=['discord_uid'])
|
||||
|
||||
@@ -13,8 +13,7 @@ class AuthServicesInfo(models.Model):
|
||||
mumble_password = models.CharField(max_length=254, default="")
|
||||
teamspeak3_uid = models.CharField(max_length=254, default="")
|
||||
teamspeak3_perm_key = models.CharField(max_length=254, default="")
|
||||
discord_username = models.CharField(max_length=254, default="")
|
||||
discord_password = models.CharField(max_length=254, default="")
|
||||
discord_uid = models.CharField(max_length=254, default="")
|
||||
main_char_id = models.CharField(max_length=64, default="")
|
||||
is_blue = models.BooleanField(default=False)
|
||||
user = models.ForeignKey(User)
|
||||
|
||||
Reference in New Issue
Block a user