I had this problem recently and was able to fix it by doing the following:
Quit PyCharm
Rename, or move the project's .idea directory
Restart PyCharm
PyCharm recreated the .idea directory but no longer was indenting code incorrectly.