Skip to content

Conversation

@kushthedude
Copy link
Member

Fixes #6043

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.

Short description of what this resolves:

Changes proposed in this pull request:

  • Addition of fields for reCAPTCHA

# CAPTCHA
#

#Google reCAPTCHA

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block comment should start with '# '

@auto-label auto-label bot added the feature label Jun 13, 2019
@kushthedude
Copy link
Member Author

@iamareebjamal @CosmicCoder96 @niranjan94 Please Review

@codecov
Copy link

codecov bot commented Jun 13, 2019

Codecov Report

Merging #6044 into development will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #6044      +/-   ##
===============================================
+ Coverage        66.15%   66.17%   +0.02%     
===============================================
  Files              285      285              
  Lines            14060    14069       +9     
===============================================
+ Hits              9301     9310       +9     
  Misses            4759     4759
Impacted Files Coverage Δ
app/models/setting.py 89.03% <100%> (+0.44%) ⬆️
app/api/schema/settings.py 100% <100%> (ø) ⬆️

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 cb19e9b...0f74887. Read the comment docs.

Copy link
Contributor

@abhinavk96 abhinavk96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 2 migration files? Please make them in a single file.

Copy link
Member

@iamareebjamal iamareebjamal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many captcha services, make it explicit, -> is_google_captcha_enabled, google_captcha_site_key

Copy link
Member

@niranjan94 niranjan94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename captcha to recaptcha. Incase we start to support multiple captcha providers in the future

gs_key=None,
gs_secret=None,
gs_bucket_name=None,
is_google_recaptcha_enabled=False,google_recaptcha_site_key=None,google_recaptcha_secret_key=None,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

@kushthedude
Copy link
Member Author

@iamareebjamal @CosmicCoder96 @niranjan94 Please have a look

# ### commands auto generated by Alembic - please adjust! ###
op.add_column('settings', sa.Column('google_recaptcha_secret_key', sa.String(), nullable=True))
op.add_column('settings', sa.Column('google_recaptcha_site_key', sa.String(), nullable=True))
op.add_column('settings', sa.Column('is_google_recaptcha_enabled', sa.Boolean(), nullable=False))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will fail as there's no default set

@iamareebjamal
Copy link
Member

Solve hound issues

@kushthedude
Copy link
Member Author

@iamareebjamal @CosmicCoder96 @niranjan94 Please review

@iamareebjamal
Copy link
Member

Please first review the PRs yourself by seeing the changes

Copy link
Member

@mrsaicharan1 mrsaicharan1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About the boolean columns, https://github.com/fossasia/open-event-frontend/blob/development/app/models/setting.js#L46,
@kushthedude They are usually computed properties which can be toggled on the frontend, if that helps. They were implemented in the previous gateways too, such as is_stripe_activated &is_paypal_activated which are toggle buttons. Used to disable the modules temporarily.

{{ui-checkbox class='toggle' checked=isCheckedAliPay onChange=(action (mut isCheckedAliPay))}}

@kushthedude
Copy link
Member Author

@iamareebjamal Did the requested changes, Please review.

# ### commands auto generated by Alembic - please adjust! ###
op.add_column('settings', sa.Column('google_recaptcha_secret', sa.String(), nullable=True))
op.add_column('settings', sa.Column('google_recaptcha_site', sa.String(), nullable=True))
op.add_column('settings', sa.Column('is_google_recaptcha_enabled', sa.Boolean(), nullable=False))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration will fail

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal i specified the default value above , its not showing in migration file , what should i do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous PRs where default has been supplied

@kushthedude
Copy link
Member Author

@iamareebjamal Please Review now , Added the server_default

@abhinavk96 abhinavk96 merged commit df1065c into fossasia:development Jun 18, 2019
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.

Add fields for reCAPTCHA Keys

6 participants