|
5 | 5 | from ordered_model.models import OrderedModel
|
6 | 6 | from polymorphic.models import PolymorphicModel
|
7 | 7 |
|
8 |
| -from app.common.enums import ( |
9 |
| - AdminGroup, |
10 |
| - Groups |
11 |
| -) |
| 8 | +from app.common.enums import AdminGroup, Groups |
12 | 9 | from app.common.permissions import BasePermissionModel, check_has_access
|
13 | 10 | from app.content.models.event import Event
|
14 | 11 | from app.content.models.user import User
|
15 |
| -from app.forms.enums import ( |
16 |
| - NativeFormFieldType as FormFieldType, |
17 |
| - NativeEventFormType as EventFormType |
18 |
| -) |
| 12 | +from app.forms.enums import NativeEventFormType as EventFormType |
| 13 | +from app.forms.enums import NativeFormFieldType as FormFieldType |
19 | 14 | from app.forms.exceptions import (
|
20 | 15 | DuplicateSubmission,
|
21 | 16 | FormNotOpenForSubmission,
|
@@ -118,7 +113,9 @@ def has_object_read_permission(self, request):
|
118 | 113 | class EventForm(Form):
|
119 | 114 |
|
120 | 115 | event = models.ForeignKey(Event, on_delete=models.CASCADE, related_name="forms")
|
121 |
| - type = models.CharField(max_length=40, choices=EventFormType.choices, default=EventFormType.SURVEY) |
| 116 | + type = models.CharField( |
| 117 | + max_length=40, choices=EventFormType.choices, default=EventFormType.SURVEY |
| 118 | + ) |
122 | 119 |
|
123 | 120 | class Meta:
|
124 | 121 | unique_together = ("event", "type")
|
@@ -218,7 +215,9 @@ class Field(OrderedModel):
|
218 | 215 | id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
|
219 | 216 | title = models.CharField(max_length=400)
|
220 | 217 | form = models.ForeignKey(Form, on_delete=models.CASCADE, related_name="fields")
|
221 |
| - type = models.CharField(max_length=40, choices=FormFieldType.choices, default=FormFieldType.TEXT_ANSWER) |
| 218 | + type = models.CharField( |
| 219 | + max_length=40, choices=FormFieldType.choices, default=FormFieldType.TEXT_ANSWER |
| 220 | + ) |
222 | 221 | required = models.BooleanField(default=False)
|
223 | 222 | order_with_respect_to = "form"
|
224 | 223 |
|
|
0 commit comments