from currencies.models import Currency


def currencies(request):
    currencies = Currency.objects.all()

    if not request.session.get('currency'):
        request.session['currency'] = Currency.objects.get(is_default__exact=True)

    return {
        'CURRENCIES': currencies,
        'currency': request.session['currency'],  # DEPRECATED
        'CURRENCY': request.session['currency']
    }

from currencies.models import Currency


def currencies(request):
    currencies = Currency.objects.all()

    if not request.session.get('currency'):
        request.session['currency'] = Currency.objects.get(is_default__exact=True)

    return {
        'CURRENCIES': currencies,
        'CURRENCY': request.session['currency']
    }

Remove the deprecated 'currency' context
Remove the deprecated 'currency' context

  from currencies.models import Currency
  
  
  def currencies(request):
      currencies = Currency.objects.all()
  
      if not request.session.get('currency'):
          request.session['currency'] = Currency.objects.get(is_default__exact=True)
  
      return {
          'CURRENCIES': currencies,
-         'currency': request.session['currency'],  # DEPRECATED
          'CURRENCY': request.session['currency']
      }
  
Remove the deprecated 'currency' context
## Code Before:
from currencies.models import Currency


def currencies(request):
    currencies = Currency.objects.all()

    if not request.session.get('currency'):
        request.session['currency'] = Currency.objects.get(is_default__exact=True)

    return {
        'CURRENCIES': currencies,
        'currency': request.session['currency'],  # DEPRECATED
        'CURRENCY': request.session['currency']
    }

## Instruction:
Remove the deprecated 'currency' context
## Code After:
from currencies.models import Currency


def currencies(request):
    currencies = Currency.objects.all()

    if not request.session.get('currency'):
        request.session['currency'] = Currency.objects.get(is_default__exact=True)

    return {
        'CURRENCIES': currencies,
        'CURRENCY': request.session['currency']
    }
