<commit_before>from django.shortcuts import render, redirect

from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import get_object_or_404

def is_staff (user):
	if user.is_staff or user.is_superuser:
		return True
	else:
		return False


@user_passes_test (is_staff)
def dashboard (request):
	c = {}
	return render (request, "dashboard.html", c)

@user_passes_test (is_staff)
def customers (request):
	from opos.models import Customers
	customers = Customers.objects.all ()
	c = {}
	c['customers'] = customers
	return render (request, "customers.html", c)

@user_passes_test (is_staff)
def customeradd (request):
	from opos.models import Customers
	from opos.forms import CustomerAddForm

	if request.method == 'POST':
		form = CustomerAddForm (request.POST)
		if form.is_valid ():
			form.save ()
			redirect ('customers')
	c = {}
	c['customeredit'] = CustomerAddForm ()
	return render (request, "customer-add.html", c)<commit_msg>typo. forgot to return redirect<commit_after>from django.shortcuts import render, redirect

from django.contrib.auth.decorators import user_passes_test
from django.shortcuts import get_object_or_404

def is_staff (user):
	if user.is_staff or user.is_superuser:
		return True
	else:
		return False


@user_passes_test (is_staff)
def dashboard (request):
	c = {}
	return render (request, "dashboard.html", c)

@user_passes_test (is_staff)
def customers (request):
	from opos.models import Customers
	customers = Customers.objects.all ()
	c = {}
	c['customers'] = customers
	return render (request, "customers.html", c)

@user_passes_test (is_staff)
def customeradd (request):
	from opos.models import Customers
	from opos.forms import CustomerAddForm

	if request.method == 'POST':
		form = CustomerAddForm (request.POST)
		if form.is_valid ():
			form.save ()
			return redirect ('customers')
	c = {}
	c['customeredit'] = CustomerAddForm ()
	return render (request, "customer-add.html", c)
{'fraction_non_alphanumeric': 0.10917478216299334, 'fraction_numerical': 0.0030753459764223477, 'mean_word_length': 5.080996884735202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4065897', 'n_tokens_mistral': 672, 'n_tokens_neox': 638, 'n_words': 178}