Skip to content

Commit

Permalink
changes done
Browse files Browse the repository at this point in the history
  • Loading branch information
gurusharan2 committed Apr 20, 2017
1 parent f09a105 commit 36ed239
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
18 changes: 10 additions & 8 deletions template.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,11 @@ def post(self, comment_id):
a = int(comment_id)
key = db.Key.from_path('Comment_db', int(comment_id), parent=None)
comment_row = db.get(key)
if comment_row.posted_by == self.read_secure_cookie("username"):
comment_row.comment = comment
comment_row.put()
self.redirect("/blog")
if comment_row:
if comment_row.posted_by == self.read_secure_cookie("username"):
comment_row.comment = comment
comment_row.put()
self.redirect("/blog")
else:
self.redirect("/blog/login")
# comment delete
Expand Down Expand Up @@ -449,10 +450,11 @@ def post(self, post_id):
a = int(post_id)
key = db.Key.from_path('Blog', int(post_id), parent=None)
post_row = db.get(key)
if post_row.posted_by == self.read_secure_cookie("username"):
post_row.post = edited_post
post_row.put()
self.redirect("/blog")
if post_row:
if post_row.posted_by == self.read_secure_cookie("username"):
post_row.post = edited_post
post_row.put()
self.redirect("/blog")
else:
self.redirect("/blog/login")
# post delete
Expand Down
Binary file modified template.pyc
Binary file not shown.
15 changes: 4 additions & 11 deletions templates/signup.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<!DOCTYPE html>
{% extends "base.html" %}

<html>
<head>
<title>Unit 2 Rot 13</title>
</head>

<body>
{% block content %}
<h1> sign up </h1>
<form method="post">
<table>
Expand Down Expand Up @@ -65,7 +60,5 @@ <h1> sign up </h1>
</table>
<button>submit</button>
</form>
<h5><a href="/blog/login">already a user ?</a></h5>
</body>

</html>
<h3><a href="/blog/login">already a user ?</a></h3>
{% endblock %}

0 comments on commit 36ed239

Please sign in to comment.