Skip to content

Commit

Permalink
#1271, #1268: Removed more superfluous permission code.
Browse files Browse the repository at this point in the history
  • Loading branch information
susanodd committed Jul 4, 2024
1 parent 3362451 commit 5d6222b
Showing 1 changed file with 0 additions and 61 deletions.
61 changes: 0 additions & 61 deletions signbank/dictionary/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -3469,12 +3469,6 @@ def assign_lemma_dataset_to_gloss(request, glossid):
@permission_required('dictionary.change_gloss')
def toggle_tag(request, glossid, tagid):

if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_tag(request, glossid, tagid)

return JsonResponse(result)
Expand All @@ -3483,12 +3477,6 @@ def toggle_tag(request, glossid, tagid):
@permission_required('dictionary.change_gloss')
def toggle_semantic_field(request, glossid, semanticfield):

if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_semanticfield(request, glossid, semanticfield)

return JsonResponse(result)
Expand All @@ -3497,12 +3485,6 @@ def toggle_semantic_field(request, glossid, semanticfield):
@permission_required('dictionary.change_gloss')
def toggle_wordclass(request, glossid, wordclass):

if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_wordclass(request, glossid, wordclass)

return JsonResponse(result)
Expand All @@ -3511,12 +3493,6 @@ def toggle_wordclass(request, glossid, wordclass):
@permission_required('dictionary.change_gloss')
def toggle_namedentity(request, glossid, namedentity):

if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_namedentity(request, glossid, namedentity)

return JsonResponse(result)
Expand All @@ -3525,24 +3501,13 @@ def toggle_namedentity(request, glossid, namedentity):
@permission_required('dictionary.change_gloss')
def toggle_handedness(request, glossid, handedness):

if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_handedness(request, glossid, handedness)

return JsonResponse(result)


@permission_required('dictionary.change_gloss')
def toggle_domhndsh(request, glossid, domhndsh):
if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_domhndsh(request, glossid, domhndsh)

Expand All @@ -3551,11 +3516,6 @@ def toggle_domhndsh(request, glossid, domhndsh):

@permission_required('dictionary.change_gloss')
def toggle_subhndsh(request, glossid, subhndsh):
if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_subhndsh(request, glossid, subhndsh)

Expand All @@ -3564,11 +3524,6 @@ def toggle_subhndsh(request, glossid, subhndsh):

@permission_required('dictionary.change_gloss')
def toggle_locprim(request, glossid, locprim):
if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_locprim(request, glossid, locprim)

Expand All @@ -3577,11 +3532,6 @@ def toggle_locprim(request, glossid, locprim):

@permission_required('dictionary.change_gloss')
def toggle_movSh(request, glossid, movSh):
if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = mapping_toggle_movSh(request, glossid, movSh)

Expand All @@ -3590,11 +3540,6 @@ def toggle_movSh(request, glossid, movSh):

@permission_required('dictionary.change_gloss')
def toggle_language_fields(request, glossid):
if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = batch_edit_update_gloss(request, glossid)

Expand All @@ -3604,12 +3549,6 @@ def toggle_language_fields(request, glossid):
@permission_required('dictionary.change_gloss')
def quick_create_sense(request, glossid):

if not request.user.is_authenticated:
return JsonResponse({})

if not request.user.has_perm('dictionary.change_gloss'):
return JsonResponse({})

result = batch_edit_create_sense(request, glossid)

return JsonResponse(result)
Expand Down

0 comments on commit 5d6222b

Please sign in to comment.