I have a piece of code below (refers to a Django admin slightly modified). My IDE (PyCharm) warns me on the last line that Local variable 'ModelForm' might be referenced before assignment .
I don’t see how this can happen, but when I comment on line 6:
with transaction.commit_manually():
then the warning disappears.
Am I missing something, or is PyCharm missing something?
Here is a piece of code. I split it into several lines and it still gives a warning. Source code snippet here (70 lines): http://pastebin.com/4UT9hRPb
ModelForm = self.get_form(request, obj, form=form) formsets = [] if request.method == 'POST':
frnhr source share