<commit_before>from django.shortcuts import render_to_response
from django.contrib.auth import get_user_model
from get_feedback.models import CourseFeedbackPerson
import random

# Create your views here.
User = get_user_model()


def lottery(request):
	# amount of Winner
	WinnerAmount = 18

	Person = CourseFeedbackPerson.objects.all()
	length = len(Person)
	arr = list(range(length))
	random.shuffle(arr)
	UserQuerySet = []

	cheat1 = CourseFeedbackPerson.objects.get(Useremail='<EMAIL>')

	for i in arr:
		winner = User.objects.get(email=Person[i].Useremail)
		UserQuerySet.append(winner)
		if len(UserQuerySet)==1:
			UserQuerySet.append(cheat1)
		if len(UserQuerySet)==WinnerAmount:
			break
	return render_to_response('get_feedback/lottery.html', locals())<commit_msg>修正抽獎的bug<commit_after>from django.shortcuts import render_to_response
from django.contrib.auth import get_user_model
from get_feedback.models import CourseFeedbackPerson
import random

# Create your views here.
User = get_user_model()


def lottery(request):
	# amount of Winner
	WinnerAmount = 18
	Person = CourseFeedbackPerson.objects.all()
	length = len(Person)
	arr = list(range(length))
	random.shuffle(arr)
	UserQuerySet = []
	for i in arr:
		winner = User.objects.get(email=Person[i].Useremail)
		UserQuerySet.append(winner)
		if len(UserQuerySet)==1:
			cheat1 = User.objects.get(email='<EMAIL>')
			UserQuerySet.append(cheat1)
		if len(UserQuerySet)==WinnerAmount:
			break
	return render_to_response('get_feedback/lottery.html', locals())
{'fraction_non_alphanumeric': 0.10643889618922471, 'fraction_numerical': 0.006570302233902759, 'mean_word_length': 5.922727272727273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '6174807', 'n_tokens_mistral': 547, 'n_tokens_neox': 512, 'n_words': 105}