Skip to content
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

Merged
merged 4 commits into from
Jun 20, 2020
Merged

Conversation

iamareebjamal
Copy link
Member

@iamareebjamal iamareebjamal commented Jun 20, 2020

And some misc. DB reference fixes

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}';"

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'

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'),

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'

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)

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
Copy link

codecov bot commented Jun 20, 2020

Codecov Report

Merging #7064 into development will increase coverage by 0.02%.
The diff coverage is 77.77%.

Impacted file tree graph

@@               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     
Impacted Files Coverage Δ
app/models/custom_form.py 84.44% <70.00%> (-11.71%) ⬇️
app/api/schema/custom_forms.py 100.00% <100.00%> (ø)
app/models/discount_code.py 94.00% <100.00%> (+0.25%) ⬆️
app/models/event_sub_topic.py 94.44% <100.00%> (+0.69%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6387753...79f0d92. Read the comment docs.

@iamareebjamal iamareebjamal merged commit e73bf88 into development Jun 20, 2020
@iamareebjamal iamareebjamal deleted the custom-form-name branch June 20, 2020 15:27
@niranjan94
Copy link
Member

Codacy Here is an overview of what got changed by this pull request:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants