diff --git a/.github/workflows/reset-db-without-sb-takedown.yaml b/.github/workflows/reset-db-without-sb-takedown.yaml deleted file mode 100644 index 53e371cdb..000000000 --- a/.github/workflows/reset-db-without-sb-takedown.yaml +++ /dev/null @@ -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 }}" - \ No newline at end of file diff --git a/src/registrar/models/user.py b/src/registrar/models/user.py index 2b5b56a78..1d508f88f 100644 --- a/src/registrar/models/user.py +++ b/src/registrar/models/user.py @@ -171,11 +171,14 @@ class User(AbstractUser): now = timezone.now().date() expiration_window = 60 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( id__in=domain_ids, expiration_date__isnull=False, expiration_date__lte=threshold_date, expiration_date__gt=now, + state__in=acceptable_statuses, ).count() return num_of_expiring_domains diff --git a/src/registrar/views/domain.py b/src/registrar/views/domain.py index 2d7d88cd6..aff32e825 100644 --- a/src/registrar/views/domain.py +++ b/src/registrar/views/domain.py @@ -327,9 +327,6 @@ class DomainRenewalView(DomainBaseView): context["hidden_security_emails"] = default_emails 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 return context