Fix a few minor errors with soft deletes

This commit is contained in:
2012-06-06 20:08:25 +01:00
parent 683e193f9a
commit a39fe76e47
3 changed files with 3 additions and 3 deletions

View File

@@ -147,7 +147,7 @@ GARGOYLE_SWITCH_DEFAULTS = {
'is_active': False, 'is_active': False,
'label': 'Disable API Backend Processing', 'label': 'Disable API Backend Processing',
'description': 'Disables backend processing for the EVE API, stops Auth hammering the API during outages', 'description': 'Disables backend processing for the EVE API, stops Auth hammering the API during outages',
} },
'eve-softkeydelete': { 'eve-softkeydelete': {
'is_active': False, 'is_active': False,
'label': 'Soft API Key Deletions', 'label': 'Soft API Key Deletions',

View File

@@ -45,7 +45,7 @@ def eveapi_add(request, post_save_redirect='/', template='eve_api/add.html'):
else: else:
msg = "An issue was encountered while trying to import key %s, Please check that you are using the correct information and try again." % form.cleaned_data['api_user_id'] msg = "An issue was encountered while trying to import key %s, Please check that you are using the correct information and try again." % form.cleaned_data['api_user_id']
messages.success(request, msg, fail_silently=True) messages.success(request, msg, fail_silently=True)
return redirect(post_save_redirect) return HttpResponseRedirect(post_save_redirect)
else: else:
form = EveAPIForm(initial={'user': request.user.id }) # An unbound form form = EveAPIForm(initial={'user': request.user.id }) # An unbound form
@@ -109,7 +109,7 @@ class EVEAPIDeleteView(DeleteView):
def delete(self, request, *args, **kwargs): def delete(self, request, *args, **kwargs):
self.object = self.get_object() self.object = self.get_object()
keyid = self.object.pk keyid = self.object.pk
if not gargoyle.is_active('eve-softkeydelete', request) if not gargoyle.is_active('eve-softkeydelete', request):
self.object.delete() self.object.delete()
else: else:
self.object.user = None self.object.user = None