minor ups

This commit is contained in:
Sanj 2011-09-01 08:53:22 +05:30
parent b3abe1e12d
commit 0d96fc6d6f

View File

@ -134,7 +134,7 @@ def add_relation(request):
relation = request.GET.get("relation", None) relation = request.GET.get("relation", None)
if feature1 == None or feature2 == None or relation == None: #TODO: split up errors :/ -- not imp. if feature1 == None or feature2 == None or relation == None: #TODO: split up errors :/ -- not imp.
return render_to_json_response({'error': 'bad request'}) return render_to_json_response({'error': 'bad request'})
if not request.user.is_staff(): if not request.user.is_staff:
return render_to_json_response({'error': 'insufficient permissions error. try logging in again? are you staff / admin?'}) return render_to_json_response({'error': 'insufficient permissions error. try logging in again? are you staff / admin?'})
#TODO: handle saving m2m between feature1 and feature2 with relation. If relation='', either remove existing relation between feature1 and feature2, or ignore if no such existing relation exists. BIG QUESTION: Here it can also deal with is_primary logic - if it sets stuff to is_primary or not, though, this needs to be conveyed to the front-end / a logic figured out to toggle the check-boxes display. #TODO: handle saving m2m between feature1 and feature2 with relation. If relation='', either remove existing relation between feature1 and feature2, or ignore if no such existing relation exists. BIG QUESTION: Here it can also deal with is_primary logic - if it sets stuff to is_primary or not, though, this needs to be conveyed to the front-end / a logic figured out to toggle the check-boxes display.