Skip to content

Commit dcc2840

Browse files
authored
BB2-3229: Added rollout logic for access grant feature flag (#1201)
* Added check for AG flag rollout * update readme to kick tests
1 parent c7cf8b5 commit dcc2840

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

apps/authorization/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def update_expiration_date(self):
4343
# For THIRTEEN_MONTH type update expiration_date
4444
if self.application:
4545
flag = get_waffle_flag_model().get("limit_data_access")
46-
if flag.id is not None and flag.is_active_for_user(self.application.user):
46+
if flag.rollout or (flag.id is not None and flag.is_active_for_user(self.application.user)):
4747
if self.application.data_access_type == "THIRTEEN_MONTH":
4848
self.expiration_date = datetime.now().replace(
4949
tzinfo=pytz.UTC
@@ -52,7 +52,7 @@ def update_expiration_date(self):
5252

5353
def has_expired(self):
5454
flag = get_waffle_flag_model().get("limit_data_access")
55-
if flag.id is not None and flag.is_active_for_user(self.application.user):
55+
if flag.rollout or (flag.id is not None and flag.is_active_for_user(self.application.user)):
5656
if self.application.data_access_type == "THIRTEEN_MONTH":
5757
if self.expiration_date:
5858
if self.expiration_date < datetime.now().replace(tzinfo=pytz.UTC):

apps/dot_ext/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ def store_media_file(self, file, filename):
229229
def has_one_time_only_data_access(self):
230230
if self.data_access_type == "ONE_TIME":
231231
flag = get_waffle_flag_model().get("limit_data_access")
232-
if flag.id is not None and flag.is_active_for_user(self.user):
232+
if flag.rollout or (flag.id is not None and flag.is_active_for_user(self.user)):
233233
return True
234234
return False
235235

apps/dot_ext/views/authorization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ def sensitive_info_check(self, request):
115115
def get_template_names(self):
116116
flag = get_waffle_flag_model().get("limit_data_access")
117117
if waffle.switch_is_active('require-scopes'):
118-
if flag.id is not None and flag.is_active_for_user(self.application.user):
118+
if flag.rollout or (flag.id is not None and flag.is_active_for_user(self.application.user)):
119119
return ["design_system/new_authorize_v2.html"]
120120
else:
121121
return ["design_system/authorize_v2.html"]
122122
else:
123-
if flag.id is not None and flag.is_active_for_user(self.user):
123+
if flag.rollout or (flag.id is not None and flag.is_active_for_user(self.user)):
124124
return ["design_system/new_authorize_v2.html"]
125125
else:
126126
return ["design_system/authorize.html"]

apps/logging/loggers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def log_global_state_metrics(group_timestamp=None, report_flag=True):
341341
grant_counts = get_grant_bene_counts(application=app)
342342

343343
flag = get_waffle_flag_model().get("limit_data_access")
344-
user_limit_data_access = flag.is_active_for_user(app.user) if flag.id is not None else None
344+
user_limit_data_access = flag.rollout or (flag.is_active_for_user(app.user) if flag.id is not None else None)
345345

346346
log_dict = {
347347
"type": "global_state_metrics_per_app",

docker-compose/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,5 +534,4 @@ or
534534
The argument can be the remote ENV's name, it can also be the URL alternatively:
535535
```
536536
./docker-compose/run_selenium_tests_remote.sh -p https://sandbox.bluebutton.cms.gov/
537-
```
538-
537+
```

0 commit comments

Comments
 (0)