from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from glossary.form import GlossaryForm
import logging
logger = logging.getLogger(__name__)


def terms(request):
    logger.debug('Glossary terms called')
    return render(request, 'glossary.html')


@login_required
def new(request):
    """Form for adding a new glossary term to the app."""
    if request.method == 'POST':
        form = GlossaryForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/glossary/')
        else:
            # Shows previously inputs in the form with errors specific to
            # invalid inputs
            return render(request, 'glossary_form.html', {'form': form})
    else:
        form = GlossaryForm()
    return render(request, 'glossary_form.html', {'form': form})

0cce1762ebf29b4343367c9849ff8aab601f0049
<mask token>


@login_required
def new(request):
    """Form for adding a new glossary term to the app."""
    if request.method == 'POST':
        form = GlossaryForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/glossary/')
        else:
            return render(request, 'glossary_form.html', {'form': form})
    else:
        form = GlossaryForm()
    return render(request, 'glossary_form.html', {'form': form})

<mask token>


def terms(request):
    logger.debug('Glossary terms called')
    return render(request, 'glossary.html')


@login_required
def new(request):
    """Form for adding a new glossary term to the app."""
    if request.method == 'POST':
        form = GlossaryForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/glossary/')
        else:
            return render(request, 'glossary_form.html', {'form': form})
    else:
        form = GlossaryForm()
    return render(request, 'glossary_form.html', {'form': form})

<mask token>
logger = logging.getLogger(__name__)


def terms(request):
    logger.debug('Glossary terms called')
    return render(request, 'glossary.html')


@login_required
def new(request):
    """Form for adding a new glossary term to the app."""
    if request.method == 'POST':
        form = GlossaryForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/glossary/')
        else:
            return render(request, 'glossary_form.html', {'form': form})
    else:
        form = GlossaryForm()
    return render(request, 'glossary_form.html', {'form': form})

from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from glossary.form import GlossaryForm
import logging
logger = logging.getLogger(__name__)


def terms(request):
    logger.debug('Glossary terms called')
    return render(request, 'glossary.html')


@login_required
def new(request):
    """Form for adding a new glossary term to the app."""
    if request.method == 'POST':
        form = GlossaryForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/glossary/')
        else:
            return render(request, 'glossary_form.html', {'form': form})
    else:
        form = GlossaryForm()
    return render(request, 'glossary_form.html', {'form': form})

from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from glossary.form import GlossaryForm
import logging
logger = logging.getLogger(__name__)


def terms(request):
    logger.debug('Glossary terms called')
    return render(request, 'glossary.html')


@login_required
def new(request):
    """Form for adding a new glossary term to the app."""
    if request.method == 'POST':
        form = GlossaryForm(request.POST)
        logger.debug(form)
        if form.is_valid():
            form.save()
            return HttpResponseRedirect('/glossary/')
        else:
            # Shows previously inputs in the form with errors specific to
            # invalid inputs
            return render(request, 'glossary_form.html', {'form': form})
    else:
        form = GlossaryForm()
    return render(request, 'glossary_form.html', {'form': form})
