Skip to content

Commit

Permalink
Added email changes,version fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vikashkum05 committed Jul 22, 2024
1 parent 9c83b4c commit 7fde739
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 25 deletions.
7 changes: 7 additions & 0 deletions .env_example
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@ INVALIDATE_CACHE_HARD=true
CACHE_CONTROL_MAX_AGE_FOR_FE=14400

API_KEY_ADMIN_DASHBOARD_URL=http://localhost:9500/admin/api-keys


EMAIL_URL=
SERVER_EMAIL_SIGNATURE=Gigamaps
[email protected]
[email protected]
MAILING_USE_CELERY=false
30 changes: 15 additions & 15 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,24 @@ name = "pypi"
[dev-packages]
django-debug-toolbar = "*"
isort = "*"
flake8 = "*"
flake8 = "==6.1.0"
dlint = "*"
flake8-bandit = "*"
flake8-blind-except = "*"
flake8-broken-line = "*"
flake8-bugbear = "*"
flake8-comprehensions = "*"
flake8-eradicate = "*"
flake8-string-format = "*"
flake8-commas = "*"
flake8-quotes = "*"
flake8-logging-format = "*"
flake8-bandit = "==4.1.1"
flake8-blind-except = "==0.2.1"
flake8-broken-line = "==1.0.0"
flake8-bugbear = "==23.12.2"
flake8-comprehensions = "==3.14.0"
flake8-eradicate = "==1.5.0"
flake8-string-format = "==0.3.0"
flake8-commas = "==2.1.0"
flake8-quotes = "==3.3.2"
flake8-logging-format = "==0.9.0"
mccabe = "*"
pep8-naming = "*"
pycodestyle = "*"
flake8-rst-docstrings = "*"
flake8-pep3101 = "*"
flake8-mutable = "*"
flake8-rst-docstrings = "==0.3.0"
flake8-pep3101 = "==2.1.0"
flake8-mutable = "==1.2.0"
coverage = "==7.3.0"
django-anymail = "==7.2"
delta-sharing = "==1.0.3"
Expand All @@ -34,7 +34,7 @@ psycopg2 = "==2.8.6"
celery = "<6.0"
ipython = "*"
django-templated-email = "*"
sentry-sdk = "*"
sentry-sdk = "==1.39.1"
newrelic = "*"
djangorestframework = ">=3.10"
drf-secure-token = "*"
Expand Down
23 changes: 23 additions & 0 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions azure-pipeline-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ name: $(SourceBranchName).$(Build.BuildId).$(Date:yyyyMMdd).$(Rev:r)

pool:
vmImage: 'ubuntu-22.04'
variables:
dockerRegistryServiceConnection: 'UNICEF_DATA_CONNECT_WEB_ACR'
variables:
dockerRegistryServiceConnection: $(DOCKER_SERVICE_CONNECTION)
dockerfilePath: './Dockerfile'
app: 'project-connect-backend-v2'
app: $(DOCKER_REPOSITORY)
imageRepositoryDev: 'dev/$(app)'
imageRepositoryStg: 'stg/$(app)'
imageRepositoryProd: 'prod/$(app)'
Expand All @@ -25,7 +25,7 @@ variables:
steps:
# Use a specific Python version
- task: UsePythonVersion@0
displayName: Building Razor with $(pythonVersion)
displayName: Building Razor with $(pythonVersion)
inputs:
versionSpec: $(pythonVersion)
addToPath: true
Expand Down Expand Up @@ -70,9 +70,9 @@ steps:
-Dsonar.sources=proco \
-Dsonar.host.url=$(SONAR_HOST) \
-Dsonar.python.coverage.reportPaths=coverage.xml \
-Dsonar.coverage.exclusions=**/migrations/**,**/proco_data_migrations/**,**/tests/**,**/proco/**/admin.py,**/dailycheckapp_contact/**,**/realtime_dailycheckapp/**,**/realtime_unicef/**,**/management/commands/**
-Dsonar.exclusions=**/migrations/**,**/proco_data_migrations/**,**/tests/**,**/proco/**/admin.py,**/dailycheckapp_contact/**,**/realtime_dailycheckapp/**,**/realtime_unicef/**,**/management/commands/**
# Docker build and push
# Docker build and push
- task: Docker@2
displayName: Dev - Build and Push image
inputs:
Expand Down
4 changes: 2 additions & 2 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@

if CELERY_ENABLED:
TEMPLATED_EMAIL_BACKEND = 'proco.mailing.backends.AsyncTemplateBackend'
MAILING_USE_CELERY = True
MAILING_USE_CELERY = env.bool('MAILING_USE_CELERY', default=False)

TEMPLATED_EMAIL_TEMPLATE_DIR = 'email'
TEMPLATED_EMAIL_FILE_EXTENSION = 'html'
Expand Down Expand Up @@ -360,7 +360,7 @@
}],
}
CONSTANCE_CONFIG = {
'CONTACT_EMAIL': ('', 'Email to receive contact messages', 'email_input'),
'CONTACT_EMAIL': (env('CONTACT_EMAIL', default=''), 'Email to receive contact messages', 'email_input'),
'DAILYCHECKAPP_CONTACT_EMAIL': ('', 'Email to receive dailycheckapp_contact messages', 'email_input'),
}

Expand Down
2 changes: 1 addition & 1 deletion config/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
# Email settings
# --------------------------------------------------------------------------

EMAIL_CONFIG = env.email()
EMAIL_CONFIG = env.email(backend=EMAIL_BACKEND)
vars().update(EMAIL_CONFIG)

SERVER_EMAIL_SIGNATURE = env('SERVER_EMAIL_SIGNATURE', default='proco'.capitalize())
Expand Down
1 change: 1 addition & 0 deletions proco/connection_statistics/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,7 @@ def calculate_country_download_data(self, start_date, end_date, week_number, yea
).filter(
realtime_registration_status__rt_registered=True,
realtime_registration_status__rt_registration_date__date__lte=end_date,
realtime_registration_status__deleted__isnull=True,
).annotate(
dummy_group_by=Value(1)).values('dummy_group_by').annotate(
good=Count(Case(When(t__connectivity_speed__gt=speed_benchmark, then='id')), distinct=True),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def populate_school_registration_data(country_id, school_id):
query = """
SELECT DISTINCT dailystat.school_id as school_id,
true rt_registered,
FIRST_VALUE(dailystat.created) OVER (PARTITION BY dailystat.school_id ORDER BY dailystat.created)
FIRST_VALUE(dailystat.date) OVER (PARTITION BY dailystat.school_id ORDER BY dailystat.date)
rt_registration_date,
NULL rt_source
FROM connection_statistics_schooldailystatus dailystat
Expand Down

0 comments on commit 7fde739

Please sign in to comment.