mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-27 21:16:28 +02:00
Merge branch 'rh/3363-uat-1-bug-fixes' of https://github.com/cisagov/manage.get.gov into rh/3363-uat-1-bug-fixes
This commit is contained in:
commit
6fd922edf1
3 changed files with 3 additions and 91 deletions
|
@ -1,88 +0,0 @@
|
||||||
# This workflow can be run from the CLI
|
|
||||||
# gh workflow run reset-db.yaml -f environment=ENVIRONMENT
|
|
||||||
# OR
|
|
||||||
# cf run-task getgov-ENVIRONMENT --command 'python manage.py flush' --name flush
|
|
||||||
# cf run-task getgov-ENVIRONMENT --command 'python manage.py load' --name loaddata
|
|
||||||
|
|
||||||
name: Reset database
|
|
||||||
run-name: Reset database for ${{ github.event.inputs.environment }} without taking down the sandbox
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
environment:
|
|
||||||
type: choice
|
|
||||||
description: Which environment should we flush and re-load data for?
|
|
||||||
options:
|
|
||||||
- staging
|
|
||||||
- development
|
|
||||||
- el
|
|
||||||
- ad
|
|
||||||
- ms
|
|
||||||
- ag
|
|
||||||
- litterbox
|
|
||||||
- hotgov
|
|
||||||
- cb
|
|
||||||
- bob
|
|
||||||
- meoward
|
|
||||||
- backup
|
|
||||||
- ky
|
|
||||||
- es
|
|
||||||
- nl
|
|
||||||
- rh
|
|
||||||
- za
|
|
||||||
- gd
|
|
||||||
- rb
|
|
||||||
- ko
|
|
||||||
- ab
|
|
||||||
- rjm
|
|
||||||
- dk
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
reset-db:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
CF_USERNAME: CF_${{ github.event.inputs.environment }}_USERNAME
|
|
||||||
CF_PASSWORD: CF_${{ github.event.inputs.environment }}_PASSWORD
|
|
||||||
steps:
|
|
||||||
- name: Unbind the database service
|
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
|
||||||
with:
|
|
||||||
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
|
||||||
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ github.event.inputs.environment }}
|
|
||||||
cf_command: "cf unbind-service getgov-${{ github.event.inputs.environment }} getgov-${{ github.event.inputs.environment }}-database"
|
|
||||||
- name: Delete the service
|
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
|
||||||
with:
|
|
||||||
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
|
||||||
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ github.event.inputs.environment }}
|
|
||||||
cf_command: "cf unbind-service getgov-${{ github.event.inputs.environment }} getgov-${{ github.event.inputs.environment }}-database"
|
|
||||||
-name: Recreate the service
|
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
|
||||||
with:
|
|
||||||
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
|
||||||
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ github.event.inputs.environment }}
|
|
||||||
cf_command: "cf create-service aws-rds micro-psql getgov-${{ github.event.inputs.environment }} getgov-${{ github.event.inputs.environment }}-database"
|
|
||||||
-name: Recreate the service
|
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
|
||||||
with:
|
|
||||||
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
|
||||||
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ github.event.inputs.environment }}
|
|
||||||
cf_command: "cf create-service aws-rds micro-psql getgov-${{ github.event.inputs.environment }} getgov-${{ github.event.inputs.environment }}-database"
|
|
||||||
-name: Rebind the service
|
|
||||||
uses: cloud-gov/cg-cli-tools@main
|
|
||||||
with:
|
|
||||||
cf_username: ${{ secrets[env.CF_USERNAME] }}
|
|
||||||
cf_password: ${{ secrets[env.CF_PASSWORD] }}
|
|
||||||
cf_org: cisa-dotgov
|
|
||||||
cf_space: ${{ github.event.inputs.environment }}
|
|
||||||
cf_command: "cf bind-service getgov-env getgov-${{ github.event.inputs.environment }}"
|
|
||||||
|
|
|
@ -171,11 +171,14 @@ class User(AbstractUser):
|
||||||
now = timezone.now().date()
|
now = timezone.now().date()
|
||||||
expiration_window = 60
|
expiration_window = 60
|
||||||
threshold_date = now + timedelta(days=expiration_window)
|
threshold_date = now + timedelta(days=expiration_window)
|
||||||
|
acceptable_statuses = [Domain.State.UNKNOWN, Domain.State.DNS_NEEDED, Domain.State.READY]
|
||||||
|
|
||||||
num_of_expiring_domains = Domain.objects.filter(
|
num_of_expiring_domains = Domain.objects.filter(
|
||||||
id__in=domain_ids,
|
id__in=domain_ids,
|
||||||
expiration_date__isnull=False,
|
expiration_date__isnull=False,
|
||||||
expiration_date__lte=threshold_date,
|
expiration_date__lte=threshold_date,
|
||||||
expiration_date__gt=now,
|
expiration_date__gt=now,
|
||||||
|
state__in=acceptable_statuses,
|
||||||
).count()
|
).count()
|
||||||
return num_of_expiring_domains
|
return num_of_expiring_domains
|
||||||
|
|
||||||
|
|
|
@ -327,9 +327,6 @@ class DomainRenewalView(DomainBaseView):
|
||||||
context["hidden_security_emails"] = default_emails
|
context["hidden_security_emails"] = default_emails
|
||||||
|
|
||||||
security_email = self.object.get_security_email()
|
security_email = self.object.get_security_email()
|
||||||
if security_email is None or security_email in default_emails:
|
|
||||||
context["security_email"] = None
|
|
||||||
return context
|
|
||||||
context["security_email"] = security_email
|
context["security_email"] = security_email
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue