Skip to content

Commit c73a2c1

Browse files
authored
Merge pull request #124 from dancergraham/docs/typo
Docs/typo
2 parents b247c5e + cbbacc5 commit c73a2c1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/api/conditions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ A [validator](https://docs.djangoproject.com/en/stable/ref/validators/) can be g
3535

3636

3737
```python
38+
from django.core.exceptions import ValidationError
3839
from flags import conditions
3940

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

5152
```python
53+
from django.core.exceptions import ValidationError
5254
from flags import conditions
5355

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

62-
conditions.register('path', fn=path_condition)
64+
conditions.register('path', fn=PathCondition)
6365
```
6466

6567
Validators specified in both ways are available on condition callables as

0 commit comments

Comments
 (0)