Пример #1
0
def admin():
	form = ChallengeForm()
	if request.method == 'POST':
		if form.validate_on_submit():
			challenge = Challenge(form.ChallengeName.data, g.user.PersonID, datetime.datetime.now())
			commit_to_db(challenge)
			flash("Successfullly created new challenge")
			return redirect(url_for('discussions_all'))
		else:
			flash("Couldn't initiate your new challenge")
			return redirect(url_for('admin'))
	if request.method == 'GET':
		new_users = get_all_persons(Confirmed = False)
		return render_template('admin.html', form = form, new_users = new_users)
Пример #2
0
def persons_list():
	persons_list = get_all_persons(Confirmed = True)
	return render_template('persons_all.html', persons = persons_list)
Пример #3
0
def usernameIsAvailable(username):
	Persons = get_all_persons()
	unavailableUsernames = [p.Username for p in Persons]
	
	return not (username in unavailableUsernames)
Пример #4
0
def persons_list():
	persons_list = get_all_persons()
	return render_template('persons_all.html', persons = persons_list)