Skip to content

Commit

Permalink
PEP8
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Dec 16, 2024
1 parent 1b84b59 commit dbec810
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/collective/formsupport/counter/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ def add_counter(context, event):

if not event.form.get(COUNTER_ENABLED_FORM_FLAG_NAME):
return

block_id = event.form_data.get("block_id")
annotations = IAnnotations(context)

if COUNTER_ANNOTATIONS_NAME not in annotations:
annotations[COUNTER_ANNOTATIONS_NAME] = PersistentMapping()

if block_id not in annotations[COUNTER_ANNOTATIONS_NAME]:
annotations[COUNTER_ANNOTATIONS_NAME][block_id] = 1

else:
annotations[COUNTER_ANNOTATIONS_NAME][block_id] += 1

0 comments on commit dbec810

Please sign in to comment.