snapshot: preserve reliability hardening and Workdock identity pass

This commit is contained in:
Md Bayazid Bostame
2026-03-27 00:28:34 +01:00
parent 811bcd8745
commit 8553482ddd
39 changed files with 1393 additions and 320 deletions

View File

@@ -6,7 +6,7 @@ from workflows.roles import ROLE_PLATFORM_OWNER, ROLE_STAFF, assign_user_role, e
DEFAULT_USERS = [
{
'username': 'admin_test',
'email': 'admin_test@tub.co',
'email': 'admin_test@workdock.de',
'password': 'admin12345',
'first_name': 'Admin',
'last_name': 'Test',
@@ -15,7 +15,7 @@ DEFAULT_USERS = [
},
{
'username': 'user_test',
'email': 'user_test@tub.co',
'email': 'user_test@workdock.de',
'password': 'user12345',
'first_name': 'Normal',
'last_name': 'User',

View File

@@ -9,6 +9,7 @@ from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.utils import timezone
from workflows.branding import get_company_email_domain
from workflows.models import EmployeeProfile, OffboardingRequest, OnboardingRequest
from workflows.tasks import process_offboarding_request, process_onboarding_request
@@ -100,8 +101,9 @@ class Command(BaseCommand):
def handle(self, *args, **options):
run_id = timezone.now().strftime('%Y%m%d%H%M%S')
employee_name = f'E2E Check {run_id}'
work_email = f'e2e.{run_id}@tub.co'
requester_email = 'e2e.requester@tub.co'
domain = get_company_email_domain()
work_email = f'e2e.{run_id}@{domain}'
requester_email = f'e2e.requester@{domain}'
created_onboarding: OnboardingRequest | None = None
created_offboarding: OffboardingRequest | None = None

View File

@@ -0,0 +1,30 @@
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import gettext as _
from workflows.backup_ops import create_backup_bundle, list_backup_bundles, verify_backup_bundle
class Command(BaseCommand):
help = 'Verifies the latest backup bundle. Can create one first if no bundle exists yet.'
def add_arguments(self, parser):
parser.add_argument(
'--create-if-missing',
action='store_true',
help='Create a new backup bundle first if none exists yet.',
)
def handle(self, *args, **options):
rows = list_backup_bundles()
if not rows:
if not options['create_if_missing']:
raise CommandError(_('Kein Backup-Bundle vorhanden.'))
created = create_backup_bundle()
backup_name = created['name']
self.stdout.write(self.style.WARNING(_('Kein Backup gefunden. Neues Bundle erstellt: %(name)s') % {'name': backup_name}))
else:
backup_name = rows[0]['name']
result = verify_backup_bundle(backup_name)
self.stdout.write(self.style.SUCCESS(_('Backup erfolgreich verifiziert: %(name)s') % {'name': backup_name}))
self.stdout.write(result['summary'])