mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Add more checks to pre-commit (#3132)
* Add bandit to pre-commit checks * fix catchall exceptions * remove unused definitons * remove unuseed ariables * Add docstring * fix B006, B008 errors * fix B007 error * ignore B009 * Add checks for formatting and naming
This commit is contained in:
		@@ -56,7 +56,7 @@ def update_history(apps, schema_editor):
 | 
			
		||||
                try:
 | 
			
		||||
                    deltas['quantity']: float(q)
 | 
			
		||||
                    updated = True
 | 
			
		||||
                except:
 | 
			
		||||
                except Exception:
 | 
			
		||||
                    print(f"WARNING: Error converting quantity '{q}'")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -89,7 +89,7 @@ def update_history(apps, schema_editor):
 | 
			
		||||
 | 
			
		||||
                        # Ensure that 'quantity' is stored too in this case
 | 
			
		||||
                        deltas['quantity'] = float(q)
 | 
			
		||||
                    except:
 | 
			
		||||
                    except Exception:
 | 
			
		||||
                        print(f"WARNING: Error converting removed quantity '{removed}'")
 | 
			
		||||
                else:
 | 
			
		||||
                    print(f"Could not decode '{title}'")
 | 
			
		||||
@@ -168,7 +168,7 @@ def update_history(apps, schema_editor):
 | 
			
		||||
 | 
			
		||||
                        # Ensure that 'quantity' is stored too in this case
 | 
			
		||||
                        deltas['quantity'] = float(q)
 | 
			
		||||
                    except:
 | 
			
		||||
                    except Exception:
 | 
			
		||||
                        print(f"WARNING: Error converting added quantity '{added}'")
 | 
			
		||||
 | 
			
		||||
                else:
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ def update_serials(apps, schema_editor):
 | 
			
		||||
        if result and len(result.groups()) == 1:
 | 
			
		||||
            try:
 | 
			
		||||
                serial = int(result.groups()[0])
 | 
			
		||||
            except:
 | 
			
		||||
            except Exception:
 | 
			
		||||
                serial = 0
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user