"""Gallery templatetags"""
from django.template import Library
from django.core.exceptions import ObjectDoesNotExist

register = Library()


@register.filter(name='divide')
def divide(dividend, divisor):
    return dividend / divisor


@register.filter(name='get_language')
def get_language(list, language):
    try:
        return list.get(language=language)
    except ObjectDoesNotExist:
        try:
            return list.get(language='en')
        except ObjectDoesNotExist:
            return list.all()[0]

"""Gallery templatetags"""
from django.template import Library
from django.core.exceptions import ObjectDoesNotExist

register = Library()


@register.filter(name='divide')
def divide(dividend, divisor):
    return dividend / divisor


@register.filter(name='get_language')
def get_language(queryset, language):
    try:
        return queryset.get(language=language)
    except ObjectDoesNotExist:
        try:
            return queryset.get(language='en')
        except ObjectDoesNotExist:
            return queryset.all()[0]

Fix variable name in get_language tag
Fix variable name in get_language tag

  """Gallery templatetags"""
  from django.template import Library
  from django.core.exceptions import ObjectDoesNotExist
  
  register = Library()
  
  
  @register.filter(name='divide')
  def divide(dividend, divisor):
      return dividend / divisor
  
  
  @register.filter(name='get_language')
- def get_language(list, language):
+ def get_language(queryset, language):
      try:
-         return list.get(language=language)
+         return queryset.get(language=language)
      except ObjectDoesNotExist:
          try:
-             return list.get(language='en')
+             return queryset.get(language='en')
          except ObjectDoesNotExist:
-             return list.all()[0]
+             return queryset.all()[0]
  
Fix variable name in get_language tag
## Code Before:
"""Gallery templatetags"""
from django.template import Library
from django.core.exceptions import ObjectDoesNotExist

register = Library()


@register.filter(name='divide')
def divide(dividend, divisor):
    return dividend / divisor


@register.filter(name='get_language')
def get_language(list, language):
    try:
        return list.get(language=language)
    except ObjectDoesNotExist:
        try:
            return list.get(language='en')
        except ObjectDoesNotExist:
            return list.all()[0]

## Instruction:
Fix variable name in get_language tag
## Code After:
"""Gallery templatetags"""
from django.template import Library
from django.core.exceptions import ObjectDoesNotExist

register = Library()


@register.filter(name='divide')
def divide(dividend, divisor):
    return dividend / divisor


@register.filter(name='get_language')
def get_language(queryset, language):
    try:
        return queryset.get(language=language)
    except ObjectDoesNotExist:
        try:
            return queryset.get(language='en')
        except ObjectDoesNotExist:
            return queryset.all()[0]
