1. Ivan Melnikov
  2. gae-wiki

Commits

Ivan Melnikov  committed a35e397 Draft

Join user

  • Participants
  • Parent commits 71acb1c
  • Branches default

Comments (0)

Files changed (3)

File template/user/add.html

View file
  • Ignore whitespace
+{% extends "index.html" %}
+
+{% block content %}
+
+<h1>Присоединиться</h1>
+
+{# add current user to list #}
+<form method="post" action="/.user">
+<input type="submit" value="Войти"/>
+</form>
+
+{% endblock %}

File template/user/list.html

View file
  • Ignore whitespace
 
 {% endfor %}
 
-
-{# add current user to list #}
-<form method="post" action="/.user">
-<input type="submit" value="Войти"/>
-</form>
-
 {% endblock %}

File user.py

View file
  • Ignore whitespace
 
 class AddUser(webapp2.RequestHandler):
 
+	def get(self):
+		users = User.all().filter('approved', None).fetch(1000)
+
+		template = jinja_environment.get_template('add.html')
+		self.response.out.write(template.render())
+
 	def post(self):
 		''' Create new user '''
 
 			u = User(user_id=user.user_id(), name=user.nickname(), email=user.email())
 			u.put()
 
-		self.redirect('/.user/all')
+		self.redirect('/')
 
 
 class ListUser(webapp2.RequestHandler):