feat: Notifications mailing system
- Added mailing system every 2 hours for notifications
- Added subscription option for every user
- Added celery task for sending mails
- Added translations for babel
Codecov Report
Merging #327 (859742e) into master (6f13160) will increase coverage by
0.20%. The diff coverage is90.62%.
:exclamation: Current head 859742e differs from pull request most recent head 48d4811. Consider uploading reports for the commit 48d4811 to get more accurate results
@@ Coverage Diff @@
## master #327 +/- ##
==========================================
+ Coverage 84.08% 84.28% +0.20%
==========================================
Files 63 66 +3
Lines 2946 3035 +89
==========================================
+ Hits 2477 2558 +81
- Misses 469 477 +8
| Impacted Files | Coverage Δ | |
|---|---|---|
| lms/lmsdb/bootstrap.py | 15.96% <20.00%> (+0.17%) |
:arrow_up: |
| lms/utils/mail.py | 98.27% <96.29%> (+1.05%) |
:arrow_up: |
| lms/lmsdb/models.py | 91.33% <100.00%> (+0.25%) |
:arrow_up: |
| lms/lmsweb/__init__.py | 97.82% <100.00%> (+0.15%) |
:arrow_up: |
| lms/lmsweb/views.py | 93.27% <100.00%> (+0.15%) |
:arrow_up: |
| lms/models/notifications.py | 90.00% <100.00%> (+0.71%) |
:arrow_up: |
| lms/models/users.py | 94.28% <100.00%> (+1.69%) |
:arrow_up: |
| lms/utils/__init__.py | 100.00% <100.00%> (ø) |
|
| lms/utils/config/__init__.py | 100.00% <100.00%> (ø) |
|
| lms/utils/config/celery.py | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 6f13160...48d4811. Read the comment docs.
Sourcery Code Quality Report
✅ Merging this PR will increase code quality in the affected files by 0.32%.
| Quality metrics | Before | After | Change |
|---|---|---|---|
| Complexity | 1.81 ⭐ | 1.77 ⭐ | -0.04 👍 |
| Method Length | 37.28 ⭐ | 37.21 ⭐ | -0.07 👍 |
| Working memory | 6.70 🙂 | 6.64 🙂 | -0.06 👍 |
| Quality | 80.66% ⭐ | 80.98% ⭐ | 0.32% 👍 |
| Other metrics | Before | After | Change |
|---|---|---|---|
| Lines | 2550 | 2698 | 148 |
| Changed files | Quality Before | Quality After | Quality Change |
|---|---|---|---|
| lms/lmsdb/bootstrap.py | 79.77% ⭐ | 80.37% ⭐ | 0.60% 👍 |
| lms/lmsdb/models.py | 84.48% ⭐ | 84.68% ⭐ | 0.20% 👍 |
| lms/lmsweb/init.py | 64.84% 🙂 | 62.45% 🙂 | -2.39% 👎 |
| lms/lmsweb/views.py | 75.31% ⭐ | 75.47% ⭐ | 0.16% 👍 |
| lms/models/notifications.py | 86.95% ⭐ | 85.84% ⭐ | -1.11% 👎 |
| lms/models/users.py | 89.57% ⭐ | 88.61% ⭐ | -0.96% 👎 |
| lms/utils/init.py | % | 99.83% ⭐ | % |
| lms/utils/mail.py | 85.34% ⭐ | 85.30% ⭐ | -0.04% 👎 |
| tests/conftest.py | 90.98% ⭐ | 91.07% ⭐ | 0.09% 👍 |
| tests/test_notifications.py | 70.46% 🙂 | 73.00% 🙂 | 2.54% 👍 |
Here are some functions in these files that still need a tune-up:
| File | Function | Complexity | Length | Working Memory | Quality | Recommendation |
|---|---|---|---|---|---|---|
| lms/lmsweb/views.py | comment | 13 🙂 | 202 😞 | 8 🙂 | 50.15% 🙂 | Try splitting into smaller methods |
| tests/test_notifications.py | TestNotification.test_user_commented_after_check | 0 ⭐ | 215 ⛔ | 12 😞 | 53.71% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| lms/lmsweb/views.py | view | 8 ⭐ | 140 😞 | 10 😞 | 56.16% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| lms/lmsweb/views.py | login | 5 ⭐ | 129 😞 | 12 😞 | 56.69% 🙂 | Try splitting into smaller methods. Extract out complex expressions |
| lms/lmsdb/models.py | Solution._base_next_unchecked | 0 ⭐ | 95 🙂 | 20 ⛔ | 57.42% 🙂 | Extract out complex expressions |
Legend and Explanation
The emojis denote the absolute quality of the code:
- ⭐ excellent
- 🙂 good
- 😞 poor
- ⛔ very poor
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.
Please see our documentation here for details on how these metrics are calculated.
We are actively working on this report - lots more documentation and extra metrics to come!
Help us improve this quality report!