editor.update_editcount correctly sets wp_enough_recent_edits.
@@ -370,11 +370,16 @@ class Editor(models.Model):
editor_log_entry.timestamp = current_datetime
editor_log_entry.save()
+ # Get the current recent editcount
+ wp_editcount_recent = self.wp_editcount_recent(
+ current_datetime=current_datetime
+ )
+
# A recent editcount of 10 is enough.
- if self.wp_editcount_recent() and self.wp_editcount_recent() >= 10:
+ if wp_editcount_recent is not None and wp_editcount_recent >= 10:
self.wp_enough_recent_edits = True
# Less than 10 is not enough.
- elif self.wp_editcount_recent():
+ elif wp_editcount_recent is not None:
self.wp_enough_recent_edits = False
# If we don't have a recent editcount yet, consider it good enough.
else:
