@@ -9,19 +9,65 @@ class LocalUnitsEmailPreview(APIView):
99
1010 def get (self , request ):
1111 type_param = request .GET .get ("type" )
12- param_types = {"new" , "update" , "validate" , "revert" , "deprecate" , "regional_validator" , "global_validator" }
12+ param_types = {
13+ "new" ,
14+ "update" ,
15+ "validate" ,
16+ "revert" ,
17+ "deprecate" ,
18+ "regional_validator" ,
19+ "global_validator" ,
20+ }
1321
1422 if type_param not in param_types :
15- return HttpResponse (f"Invalid type parameter. Please use one of the following values: { ', ' .join (param_types )} ." )
23+ return HttpResponse (f"Invalid ' type' parameter. Please use one of the following values: { ', ' .join (param_types )} ." )
1624
1725 context_mapping = {
18- "new" : {"new_local_unit" : True , "validator_email" : "Test Validator" , "full_name" : "Test User" },
19- "update" : {"update_local_unit" : True , "validator_email" : "Test Validator" , "full_name" : "Test User" },
20- "validate" : {"validate_success" : True , "full_name" : "Test User" },
21- "revert" : {"revert_reason" : "Test Reason" , "full_name" : "Test User" },
22- "deprecate" : {"deprecate_local_unit" : True , "deprecate_reason" : "Test Deprecate Reason" , "full_name" : "Test User" },
23- "regional_validator" : {"is_validator_regional_admin" : True , "full_name" : "Regional User" },
24- "global_validator" : {"is_validator_global_admin" : True , "full_name" : "Global User" },
26+ "new" : {
27+ "new_local_unit" : True ,
28+ "validator_email" : "Test Validator" ,
29+ "full_name" : "Test User" ,
30+ "country" : "Test Country" ,
31+ },
32+ "update" : {
33+ "update_local_unit" : True ,
34+ "update_reason_overview" : "Test update reason" ,
35+ "validator_email" : "Test Validator" ,
36+ "full_name" : "Test User" ,
37+ "country" : "Test Country" ,
38+ "country_id" : 1 ,
39+ },
40+ "validate" : {
41+ "validate_success" : True ,
42+ "full_name" : "Test User" ,
43+ "country" : "Test Country" ,
44+ "country_id" : 1 ,
45+ },
46+ "revert" : {
47+ "revert_reason" : "Test Reason" ,
48+ "full_name" : "Test User" ,
49+ "country" : "Test Country" ,
50+ "country_id" : 1 ,
51+ },
52+ "deprecate" : {
53+ "deprecate_local_unit" : True ,
54+ "deprecate_reason" : "Test Deprecate Reason" ,
55+ "full_name" : "Test User" ,
56+ "country" : "Test Country" ,
57+ "country_id" : 1 ,
58+ },
59+ "regional_validator" : {
60+ "is_validator_regional_admin" : True ,
61+ "full_name" : "Regional User" ,
62+ "country" : "Test Country" ,
63+ "country_id" : 1 ,
64+ },
65+ "global_validator" : {
66+ "is_validator_global_admin" : True ,
67+ "full_name" : "Global User" ,
68+ "country" : "Test Country" ,
69+ "country_id" : 1 ,
70+ },
2571 }
2672
2773 context = context_mapping .get (type_param )
0 commit comments