<commit_before>from flask_admin import BaseView, expose
from flask_admin.contrib.sqla import ModelView
from flask_admin.actions import action
from flask import request, url_for, redirect
from ..admin import am
from ..models import *
from flask.ext.login import current_user
import uuid

# Logic for handling and displaying Node Requests
class NodeRequestModelView(ModelView):

	def is_accessible(self):
		if current_user.is_authenticated:
			return current_user.can(Permission.ADMINISTER)

	can_edit = False
	# can_create = False
	column_labels = dict(
		name = "Name",
		username = "User Name",
		password = "Password",
		ip_addr = "IP Address",
		email = "Email Address",
		)
	list_template = "admin/nodeRequest_list.html"

	@action('approve', 'Approve', 'Are you sure you want to approve selected nodes?')
	def action_approve(self, ids):
		try:
			query = NodeRequest.query.filter(NodeRequest.id.in_(ids))

			# Create requests
			nodes = []
			for req in query.all():
				node = 	Node(<commit_msg>removed ability to create node requests<commit_after>from flask_admin import BaseView, expose
from flask_admin.contrib.sqla import ModelView
from flask_admin.actions import action
from flask import request, url_for, redirect
from ..admin import am
from ..models import *
from flask.ext.login import current_user
import uuid

# Logic for handling and displaying Node Requests
class NodeRequestModelView(ModelView):

	def is_accessible(self):
		if current_user.is_authenticated:
			return current_user.can(Permission.ADMINISTER)

	can_edit = False
	can_create = False
	column_labels = dict(
		name = "Name",
		username = "User Name",
		password = "Password",
		ip_addr = "IP Address",
		email = "Email Address",
		)
	list_template = "admin/nodeRequest_list.html"

	@action('approve', 'Approve', 'Are you sure you want to approve selected nodes?')
	def action_approve(self, ids):
		try:
			query = NodeRequest.query.filter(NodeRequest.id.in_(ids))

			# Create requests
			nodes = []
			for req in query.all():
				node = 	Node(
{'fraction_non_alphanumeric': 0.09427443237907206, 'fraction_numerical': 0.0, 'mean_word_length': 4.6149584487534625, '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': '2453002', 'n_tokens_mistral': 679, 'n_tokens_neox': 610, 'n_words': 192}