-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add name to custom form fields #7064
Conversation
for form, dict_map in CUSTOM_FORM_IDENTIFIER_NAME_MAP.items(): | ||
for identifier, name in dict_map.items(): | ||
statements.append( | ||
f"UPDATE custom_forms SET name = '{name}' WHERE form = '{form}' and field_identifier = '{identifier}';" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (119 > 90 characters)
def test_custom_form_name(db): | ||
event = EventFactoryBasic() | ||
speaker_custom_form = CustomForms( | ||
event=event, field_identifier='speakingExperience', form='speaker', type='text' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
@@ -11,6 +12,9 @@ | |||
|
|||
class DiscountCode(SoftDeletionModel): | |||
__tablename__ = "discount_codes" | |||
__table_args__ = ( | |||
UniqueConstraint('event_id', 'code', name='uq_event_discount_code'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
@@ -11,8 +11,8 @@ class Meta: | |||
model = CustomForms | |||
|
|||
event = factory.RelatedFactory(EventFactoryBasic) | |||
form = common.string_ | |||
field_identifier = common.string_ | |||
form = 'attendee' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
@@ -13,7 +13,7 @@ class Meta: | |||
model = DiscountCode | |||
|
|||
marketer = factory.RelatedFactory(UserFactory) | |||
code = common.string_ | |||
code = factory.Sequence(lambda n: 'john%s' % n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
Codecov Report
@@ Coverage Diff @@
## development #7064 +/- ##
===============================================
+ Coverage 61.59% 61.61% +0.02%
===============================================
Files 260 260
Lines 12890 12914 +24
===============================================
+ Hits 7939 7957 +18
- Misses 4951 4957 +6
Continue to review full report at Codecov.
|
Complexity increasing per file
==============================
- tests/all/integration/models/custom_form_tests.py 11
- app/models/custom_form.py 3
See the complete overview on Codacy |
And some misc. DB reference fixes