Commit 9e60485ebc548cb2f021e89faa56c9e662e2c922

Authored by Bartłomiej Nitoń
1 parent 565a7dad

Lemma_status_change error fix.

dictionary/ajax_lemma_status.py
... ... @@ -106,6 +106,9 @@ def status_need_validation(request, status_id, lemma_id):
106 106  
107 107 @ajax(method='post')
108 108 def lemma_status_change(request, status_id, lemma_id):
  109 + if not request.user.is_authenticated():
  110 + raise AjaxError('user logged out')
  111 +
109 112 try:
110 113 lemma_obj = Lemma.objects.get(id=lemma_id, old=False)
111 114 except Lemma.DoesNotExist:
... ...
dictionary/static/js/lemma-view.js
... ... @@ -3490,6 +3490,11 @@ function lemma_status_change(status_id) {
3490 3490 error_alert('Nie można zmienić statusu nieaktualnej wersji hasła.');
3491 3491 return false;
3492 3492 }
  3493 + else if(result == 'user logged out') {
  3494 + HideProgressAnimation();
  3495 + alertUserNotAuthenticated();
  3496 + return false;
  3497 + }
3493 3498 else {
3494 3499 HideProgressAnimation();
3495 3500 return true;
... ...