mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-20 08:03:51 -04:00
Add update_letter_branding view function
This works in a similar way to the create_letter_branding view function, but with a few minor differences: * Since we already have a file, uploading a file is no longer required (since we can just use the current file if a new one is not uploaded) * We save the changes in the database, then upload the new files to S3. If saving to S3 raises an error, we now rollback the database changes to prevent any errors when trying to view letters with the original logo.
This commit is contained in:
@@ -2540,7 +2540,7 @@ def mock_get_all_letter_branding(mocker):
|
||||
'id': str(UUID(int=1)),
|
||||
'name': 'Land Registry',
|
||||
'filename': 'land-registry',
|
||||
'domain': None,
|
||||
'domain': 'landregistry.gov.uk',
|
||||
},
|
||||
{
|
||||
'id': str(UUID(int=2)),
|
||||
@@ -2562,7 +2562,7 @@ def mock_get_letter_branding_by_id(mocker):
|
||||
'id': _id,
|
||||
'name': 'HM Government',
|
||||
'filename': 'hm-government',
|
||||
'domain': None,
|
||||
'domain': 'cabinet-office.gov.uk',
|
||||
}
|
||||
return mocker.patch(
|
||||
'app.letter_branding_client.get_letter_branding', side_effect=_get_branding_by_id
|
||||
|
||||
Reference in New Issue
Block a user