<commit_before>package controllers.crud;

import java.util.List;

import javax.inject.Inject;

import models.User;
import models.dao.UserDAO;
import play.Logger;
import play.Logger.ALogger;
import play.data.Form;
import play.mvc.Call;
import play.mvc.Result;
import play.utils.crud.CRUDController;

import com.avaje.ebean.Page;

import controllers.routes;
import forms.BulkUser;

public class UserCRUDController extends CRUDController<String, User> {

	private static final int PAGE_SIZE = 20;

	private static ALogger log = Logger.of(UserCRUDController.class);

	private UserDAO userDAO;

	private Form<BulkUser> bulkForm = form(BulkUser.class);

	@Inject
	public UserCRUDController(UserDAO userDAO) {
		super(userDAO, form(User.class), String.class, User.class, PAGE_SIZE,
				"lastLogin desc");
		this.userDAO = userDAO;
	}

	@Override
	protected String templateForForm() {
		return "admin.userForm";
	}

	@Override
	protected String templateForList() {
		return "admin.userList";
	}

	@Override
	protected String templateForShow() {
		return "admin.userShow";
	}

	@Override
	protected Call toIndex() {
		return routes.Admin.userList(null, 0);
	}

	public Result approve(String key, int page) {
		if (log.isDebugEnabled())
			log.debug("userApprove() <-");

		User user = userDAO.get(key);
		user.setStatus(User.Status.APPROVED);
		if (log.isDebugEnabled())
			log.debug("user : " + user);

		userDAO.update(key, user);
		return list(page);
	}

	public Result suspend(String key, int page) {
		if (log.isDebugEnabled())
			log.debug("userSuspend() <-");

		User user = userDAO.get(key);
		user.setStatus(User.Status.SUSPENDED);
		if (log.isDebugEnabled())
			log.debug("user : " + user);

		userDAO.update(key, user);
		return list(page);
	}

	public Result list(String status, int page) {<commit_msg>fix minor approve error<commit_after>package controllers.crud;

import java.util.List;

import javax.inject.Inject;

import models.User;
import models.dao.UserDAO;
import play.Logger;
import play.Logger.ALogger;
import play.data.Form;
import play.mvc.Call;
import play.mvc.Result;
import play.utils.crud.CRUDController;

import com.avaje.ebean.Page;

import controllers.routes;
import forms.BulkUser;

public class UserCRUDController extends CRUDController<String, User> {

	private static final int PAGE_SIZE = 20;

	private static ALogger log = Logger.of(UserCRUDController.class);

	private UserDAO userDAO;

	private Form<BulkUser> bulkForm = form(BulkUser.class);

	@Inject
	public UserCRUDController(UserDAO userDAO) {
		super(userDAO, form(User.class), String.class, User.class, PAGE_SIZE,
				"lastLogin desc");
		this.userDAO = userDAO;
	}

	@Override
	protected String templateForForm() {
		return "admin.userForm";
	}

	@Override
	protected String templateForList() {
		return "admin.userList";
	}

	@Override
	protected String templateForShow() {
		return "admin.userShow";
	}

	@Override
	protected Call toIndex() {
		return routes.Admin.userList(null, 0);
	}

	public Result approve(String key, int page) {
		if (log.isDebugEnabled())
			log.debug("userApprove() <-");

		User user = userDAO.get(key);
		user.setStatus(User.Status.APPROVED);
		if (log.isDebugEnabled())
			log.debug("user : " + user);

		userDAO.update(key, user);
		return list(null, page);
	}

	public Result suspend(String key, int page) {
		if (log.isDebugEnabled())
			log.debug("userSuspend() <-");

		User user = userDAO.get(key);
		user.setStatus(User.Status.SUSPENDED);
		if (log.isDebugEnabled())
			log.debug("user : " + user);

		userDAO.update(key, user);
		return list(null, page);
	}

	public Result list(String status, int page) {
{'fraction_non_alphanumeric': 0.1277533039647577, 'fraction_numerical': 0.0016519823788546256, 'mean_word_length': 4.5892307692307694, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '4322555', 'n_tokens_mistral': 1339, 'n_tokens_neox': 1243, 'n_words': 281}