projects
/
zzz-floof.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test suite runs and passes!
[zzz-floof.git]
/
floof
/
controllers
/
relation.py
diff --git
a/floof/controllers/relation.py
b/floof/controllers/relation.py
index
48e7a46
..
330559e
100644
(file)
--- a/
floof/controllers/relation.py
+++ b/
floof/controllers/relation.py
@@
-1,13
+1,14
@@
import logging
import logging
-from pylons import request, response, session, tmpl_context as c,
h,
url
+from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from pylons.controllers.util import abort, redirect
+from floof.lib import helpers as h
from floof.lib.base import BaseController, render
log = logging.getLogger(__name__)
from floof.lib.base import BaseController, render
log = logging.getLogger(__name__)
-from floof.model import Art, UserRelation
+from floof.model import Art, UserRelation
ship
from floof.model.users import User
import elixir
from floof.model.users import User
import elixir
@@
-20,11
+21,11
@@
class RelationController(BaseController):
user = h.get_object_or_404(User, name=request.params['username'])
## TODO: actually, this should act like a form validation.
user = h.get_object_or_404(User, name=request.params['username'])
## TODO: actually, this should act like a form validation.
- prior_relation = UserRelation.get_by(art=art, user=user)
+ prior_relation = UserRelation
ship
.get_by(art=art, user=user)
if prior_relation:
abort(404) ## should be a validation error
if prior_relation:
abort(404) ## should be a validation error
- relation = UserRelation(user=user, kind=kind, art=art, creator=c.user)
+ relation = UserRelation
ship
(user=user, kind=kind, art=art, creator=c.user)
elixir.session.commit()
redirect(url('show_art', id=art_id))
elixir.session.commit()
redirect(url('show_art', id=art_id))