Reputation: 1
I am getting the following error: How can I fix it?
File "/Users/rjeudy/PycharmProjects/virtualenv/virtualenv/src/products/forms.py", line 35 def clean_title(self, *args, **kwargs): ^ TabError: inconsistent use of tabs and spaces in indentation
def clean_title(self, *args, **kwargs):
title = self.cleaned_data.get("title")
if "CFE" in title:
return title
Upvotes: 0
Views: 277
Reputation: 37
Welcome to SO.
It's your indentation. If you're using PyCharm you can reformat your code and or auto-indent the lines.
In the taskbar: code -> auto-indent lines.
https://www.jetbrains.com/help/pycharm/reformat-and-rearrange-code.html
Upvotes: 0
Reputation: 1850
The problem is that you are using both tabs and spaces inconsistently.
If you use vim as your text editor you can fix this with ':retab'
Upvotes: 1