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

@@ -37,7 +37,7 @@ def add_optimer_view(request):
# Get Current Time
post_time = timezone.now()
# Get character
auth_info = AuthServicesInfo.objects.get_or_create(user=request.user)[0]
auth_info = AuthServicesInfo.objects.get(user=request.user)
character = EveManager.get_character_by_id(auth_info.main_char_id)
# handle valid form
op = optimer()
@@ -88,7 +88,7 @@ def edit_optimer(request, optimer_id):
form = opForm(request.POST)
logger.debug("Received POST request containing update optimer form, is valid: %s" % form.is_valid())
if form.is_valid():
auth_info = AuthServicesInfo.objects.get_or_create(user=request.user)[0]
auth_info = AuthServicesInfo.objects.get(user=request.user)
character = EveManager.get_character_by_id(auth_info.main_char_id)
op.doctrine = form.cleaned_data['doctrine']
op.system = form.cleaned_data['system']