-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3827 from uktrade/develop
Release PR
- Loading branch information
Showing
27 changed files
with
347 additions
and
275 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import logging | ||
|
||
from django.core.management import BaseCommand | ||
|
||
from core.helpers import send_hcsat_feedback | ||
from core.models import HCSAT | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class Command(BaseCommand): | ||
help = 'Submit HCSAT Feedback to Forms API' | ||
|
||
def handle(self, *args, **options): | ||
try: | ||
data = {'hcsat_feedback_entries': []} | ||
for feedback in HCSAT.objects.all(): | ||
data['hcsat_feedback_entries'].append( | ||
{ | ||
'id': feedback.pk, | ||
'feedback_submission_date': feedback.created.strftime('%Y-%m-%d %H:%M:%S'), | ||
'url': feedback.URL, | ||
'user_journey': feedback.user_journey, | ||
'satisfaction_rating': feedback.satisfaction_rating, | ||
'experienced_issues': feedback.experienced_issues, | ||
'other_detail': feedback.other_detail, | ||
'service_improvements_feedback': feedback.service_improvements_feedback, | ||
'likelihood_of_return': feedback.likelihood_of_return, | ||
'service_name': feedback.service_name, | ||
'service_specific_feedback': feedback.service_specific_feedback, | ||
'service_specific_feedback_other': feedback.service_specific_feedback_other, | ||
}, | ||
) | ||
send_hcsat_feedback(data) | ||
except Exception as e: | ||
logger.exception(f'Submit HCSAT Feedback to Forms API Exception {str(e)}') | ||
raise e | ||
else: | ||
HCSAT.objects.all().delete() | ||
self.stdout.write(self.style.SUCCESS('All done, bye!')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.