We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7adfa51 + 5de9829 commit c9e43cfCopy full SHA for c9e43cf
1 file changed
rules.yml
@@ -79,3 +79,16 @@ rules:
79
pattern-either:
80
- pattern-regex: image\.accession\.thumbnail_256[.\s,\)]
81
- pattern-regex: image\.accession\.sponsored_thumbnail_256_blob[.\s,\)]
82
+
83
+ - id: require-staff-readonly-admin
84
+ languages:
85
+ - python
86
+ severity: ERROR
87
+ message: Admin classes must inherit from StaffReadonlyAdmin, not admin.ModelAdmin directly.
88
+ patterns:
89
+ - pattern: |
90
+ class $CLASS(admin.ModelAdmin):
91
+ ...
92
+ - pattern-not: |
93
+ class StaffReadonlyAdmin(admin.ModelAdmin):
94
0 commit comments