log = logging.getLogger(__name__)
-from floof.model import Art, UserRelation
+from floof.model import Art, UserRelationship
from floof.model.users import User
import elixir
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 = UserRelationship.get_by(art=art, user=user)
if prior_relation:
abort(404) ## should be a validation error
- relation = UserRelation(user=user, kind=kind, art=art, creator=c.user)
+ relation = UserRelationship(user=user, kind=kind, art=art, creator=c.user)
elixir.session.commit()
redirect(url('show_art', id=art_id))