projects
/
mediagoblin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4cf5b01
)
write a function to extract blog post state from create/edit form.
author
Aditi
<aditi.iitr@gmail.com>
Wed, 7 Aug 2013 12:28:01 +0000
(17:58 +0530)
committer
Aditi
<aditi.iitr@gmail.com>
Wed, 7 Aug 2013 12:28:01 +0000
(17:58 +0530)
mediagoblin/media_types/blog/lib.py
patch
|
blob
|
blame
|
history
diff --git
a/mediagoblin/media_types/blog/lib.py
b/mediagoblin/media_types/blog/lib.py
index f95ecca54678dc1dda64d4fa4cd5be0793b26527..0725b5b6c4499e30f8b3ae94fe8aa1eb7807d06d 100644
(file)
--- a/
mediagoblin/media_types/blog/lib.py
+++ b/
mediagoblin/media_types/blog/lib.py
@@
-27,4
+27,10
@@
def may_edit_blogpost(request, blog):
if request.user.is_admin or request.user.id == blog.author:
return True
return False
+
+def set_blogpost_state(request, blogpost):
+ if request.form['status'] == 'Publish':
+ blogpost.state = u'processed'
+ else:
+ blogpost.state = u'failed'