Fixed some SonarQube issues.

This commit is contained in:
Akshay Joshi
2021-03-02 14:53:05 +05:30
parent faa66f1636
commit 008bc6da28
12 changed files with 46 additions and 43 deletions

View File

@@ -941,14 +941,14 @@ def set_master_password():
if not config.SERVER_MODE and config.MASTER_PASSWORD_REQUIRED:
# if master pass is set previously
if current_user.masterpass_check is not None:
if data.get('button_click') and \
not validate_master_password(data.get('password')):
return form_master_password_response(
existing=True,
present=False,
errmsg=gettext("Incorrect master password")
)
if current_user.masterpass_check is not None and \
data.get('button_click') and \
not validate_master_password(data.get('password')):
return form_master_password_response(
existing=True,
present=False,
errmsg=gettext("Incorrect master password")
)
if data != '' and data.get('password', '') != '':

View File

@@ -17,8 +17,6 @@ export function Search() {
const wrapperRef = useRef(null);
const [searchTerm, setSearchTerm] = useState('');
const [isShowMinLengthMsg, setIsShowMinLengthMsg] = useState(false);
let helpLinkTitles = [];
let helpLinks = [];
const [isMenuLoading, setIsMenuLoading] = useState(false);
const [isHelpLoading, setIsHelpLoading] = useState(false);
const [menuSearchResult, setMenuSearchResult] = useState({
@@ -51,11 +49,6 @@ export function Search() {
// Below will be called when any changes has been made to state
useEffect(() => {
helpLinkTitles = Object.keys(helpSearchResult.data);
for(let i = 0; i<helpLinkTitles.length;i++){
helpLinks.push(<a href={''} target='_blank' rel='noreferrer'>helpLinkTitles[i]</a>);
}
if(menuSearchResult.fetched == true){
setIsMenuLoading(false);
}