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
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'
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.