Enforce unique AuthServicesInfo (#618)

Alter user field to OneToOneField
Migration to enforce uniqueness pre-change
Migration to ensure all users have an AuthServicesInfo
Receiver to automatically create one upon user creation
Replace AuthServicesInfo.get_or_create with get
Prevent deletion of AuthServicesInfo from admin site
Remove add and delete permissions from model.

Get character names in chunks on corpstats update to prevent HTTP400 when requesting >350(ish) names

Include corpstats docs.
Update settings docs.
This commit is contained in:
Adarnof
2017-01-11 21:48:20 -05:00
committed by GitHub
parent 33c2ba9bca
commit 8360371ab7
26 changed files with 406 additions and 129 deletions

View File

@@ -104,7 +104,7 @@ def srp_fleet_add_view(request):
form = SrpFleetMainForm(request.POST)
logger.debug("Request type POST contains form valid: %s" % form.is_valid())
if form.is_valid():
authinfo = AuthServicesInfo.objects.get_or_create(user=request.user)[0]
authinfo = AuthServicesInfo.objects.get(user=request.user)
character = EveManager.get_character_by_id(authinfo.main_char_id)
srp_fleet_main = SrpFleetMain()
@@ -231,7 +231,7 @@ def srp_request_view(request, fleet_srp):
logger.debug("Request type POST contains form valid: %s" % form.is_valid())
if form.is_valid():
authinfo = AuthServicesInfo.objects.get_or_create(user=request.user)[0]
authinfo = AuthServicesInfo.objects.get(user=request.user)
character = EveManager.get_character_by_id(authinfo.main_char_id)
srp_fleet_main = SrpFleetMain.objects.get(fleet_srp_code=fleet_srp)
post_time = timezone.now()