Skip to content

Commit

Permalink
Merge pull request #124 from dancergraham/docs/typo
Browse files Browse the repository at this point in the history
Docs/typo
  • Loading branch information
willbarton authored May 16, 2024
2 parents b247c5e + cbbacc5 commit c73a2c1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/api/conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ A [validator](https://docs.djangoproject.com/en/stable/ref/validators/) can be g


```python
from django.core.exceptions import ValidationError
from flags import conditions

def validate_path(value):
Expand All @@ -49,6 +50,7 @@ def path_condition(path, request=None, **kwargs):
Or as an attribute on the condition callable:

```python
from django.core.exceptions import ValidationError
from flags import conditions

class PathCondition:
Expand All @@ -59,7 +61,7 @@ class PathCondition:
if not value.startswith('/'):
raise ValidationError('Enter a valid path')

conditions.register('path', fn=path_condition)
conditions.register('path', fn=PathCondition)
```

Validators specified in both ways are available on condition callables as
Expand Down

0 comments on commit c73a2c1

Please sign in to comment.