mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-07-13 14:30:17 +02:00
Create missing Corp/Alliance models.
Thanks @Lof79
This commit is contained in:
parent
e52478c9aa
commit
21782293ea
@ -124,8 +124,9 @@ class AutogroupsConfig(models.Model):
|
|||||||
return
|
return
|
||||||
group = self.get_alliance_group(alliance)
|
group = self.get_alliance_group(alliance)
|
||||||
except EveAllianceInfo.DoesNotExist:
|
except EveAllianceInfo.DoesNotExist:
|
||||||
logger.warning('User {} main characters alliance does not exist in the database.'
|
logger.debug('User {} main characters alliance does not exist in the database. Creating.'.format(user))
|
||||||
' Group membership not updated'.format(user))
|
alliance = EveAllianceInfo.objects.create_alliance(user.profile.main_character.alliance_id)
|
||||||
|
group = self.get_alliance_group(alliance)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.warning('User {} does not have a main character. Group membership not updated'.format(user))
|
logger.warning('User {} does not have a main character. Group membership not updated'.format(user))
|
||||||
finally:
|
finally:
|
||||||
@ -144,8 +145,9 @@ class AutogroupsConfig(models.Model):
|
|||||||
corp = user.profile.main_character.corporation
|
corp = user.profile.main_character.corporation
|
||||||
group = self.get_corp_group(corp)
|
group = self.get_corp_group(corp)
|
||||||
except EveCorporationInfo.DoesNotExist:
|
except EveCorporationInfo.DoesNotExist:
|
||||||
logger.warning('User {} main characters corporation does not exist in the database.'
|
logger.debug('User {} main characters corporation does not exist in the database. Creating.'.format(user))
|
||||||
' Group membership not updated'.format(user))
|
corp = EveCorporationInfo.objects.create_corporation(user.profile.main_character.corporation_id)
|
||||||
|
group = self.get_corp_group(corp)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.warning('User {} does not have a main character. Group membership not updated'.format(user))
|
logger.warning('User {} does not have a main character. Group membership not updated'.format(user))
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user