Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Danial/eds 228 geographic discount - #306

Merged
danialmalik merged 1 commit into
developfrom
danial/EDS-228-geographic-discount
Feb 26, 2020
Merged

Danial/eds 228 geographic discount#306
danialmalik merged 1 commit into
developfrom
danial/EDS-228-geographic-discount

Conversation

@danialmalik

@danialmalik danialmalik commented Feb 19, 2020

Copy link
Copy Markdown

Story Link

Geographic Location Discount

PR Description

When a user enrolls in a course, check if the course has a verified mode and user's country is in the list of eligible countries for discount. If yes, then create a coupon and send him the voucher.

Type of change

Please select the options that are relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Change

Checklist before merging:

  • Squased
  • Reviewd

@danialmalik danialmalik self-assigned this Feb 19, 2020
@pep8speaks

pep8speaks commented Feb 19, 2020

Copy link
Copy Markdown

Hello @danialmalik! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2020-02-26 08:31:37 UTC

@danialmalik
danialmalik force-pushed the danial/EDS-228-geographic-discount branch from 0f77ee3 to aa56471 Compare February 25, 2020 06:46

@HamzaIbnFarooq HamzaIbnFarooq Feb 25, 2020

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if not settings.FEATURES['ENABLE_GEOGRAPHIC_DISCOUNTS']:
if not settings.FEATURES.get('ENABLE_GEOGRAPHIC_DISCOUNTS'):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

not necessarily required as I am providing a default value in config but let's change it anyways to be on safe side

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

unused import?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
is_request_for_voucher_sent, message = ecommerce_client.assing_voucher_to_user(
is_request_for_voucher_sent, message = ecommerce_client.assign_voucher_to_user(

?

@danialmalik danialmalik Feb 25, 2020

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

👍

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
is_request_for_voucher_sent, message = ecommerce_client.assing_voucher_to_user(
is_voucher_assigned, message = ecommerce_client.assing_voucher_to_user(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it would be better if we create a variable like self.user = user instead of passing it in functions

Comment thread lms/envs/production.py Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need this check.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes otherwise the default value will be overwritten

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

are you sure?

@danialmalik
danialmalik force-pushed the danial/EDS-228-geographic-discount branch 2 times, most recently from 099c1f2 to 7e03fac Compare February 26, 2020 08:24
@danialmalik
danialmalik force-pushed the danial/EDS-228-geographic-discount branch from 7e03fac to c5c6b89 Compare February 26, 2020 08:31
@danialmalik
danialmalik marked this pull request as ready for review February 26, 2020 08:32
@danialmalik danialmalik added the waiting for review Waiting for review label Feb 26, 2020
@danialmalik
danialmalik merged commit d7e68f8 into develop Feb 26, 2020
@danialmalik
danialmalik deleted the danial/EDS-228-geographic-discount branch February 26, 2020 10:23
@danialmalik danialmalik removed the waiting for review Waiting for review label Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants