-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove repetitive safe_query #7001
Comments
See last commit of #6997 for more info |
@iamareebjamal I want to work on this issue. |
@satya7289 Go ahead. |
I think @iamareebjamal has already been resolved this issue. |
Not really? |
I got it. I have to convert the all safe_query(Session, 'id', view_kwargs['session_id'], 'session_id')
Am I right? . @iamareebjama |
No, you need to create a new method which takes the dictionary and key and does the same thing as safe query but without repetition |
I'm actually new in this, I do not understand 'safe query but without repetition' part, need some more clarification. @iamareebjamal |
You have to change |
You'll find a lot of unnecessary and repetitive
safe_query
calls likesafe_query(db, Session, 'id', view_kwargs['session_id'], 'session_id')
First of all, all of this should be abstracted, manually calling this is the ultimate source of bugs. However, that will take massive restructuring of the project and hence, for now, just refactor it to be simpler, like
safe_query_kwargs(Session, view_kwargs, 'session_id')
, that's all the info it needs to do its thing, no need for extra verbosity. If possible, change tosafe_query_by_id(Session, view_kwargs['session_id'])
The text was updated successfully, but these errors were encountered: