Skip to content

Refactored Region "activeTF" flag to be "is_active" #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ def test_get_region_list(self):
'regions': [
{
'id': 'norcal',
'activeTF': True,
'is_active': True,
'display_name': 'Norcal',
'ranking_num_tourneys_attended': 2,
'ranking_activity_day_limit': 60,
'tournament_qualified_day_limit': 999
},
{
'id': 'texas',
'activeTF': True,
'is_active': True,
'display_name': 'Texas',
'ranking_num_tourneys_attended': 2,
'ranking_activity_day_limit': 60,
Expand All @@ -223,7 +223,7 @@ def test_get_region_list(self):
def test_change_region_active_flag(self, mock_admin_user):
data = {
'region_id': 'norcal',
'activeTF': 'false'
'is_active': 'false'
}

response = self.app.post('/regions', data=json.dumps(data), content_type='application/json')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ angular.module('app.tools').controller("AdminFunctionsController", function($sco

$scope.changeRegionActiveTF = function(region){
var region_id = region.id;
var newActiveTF = !(region.activeTF)
var newIsActive = !(region.is_active)

var url = hostname + 'regions';
var postParams = {
region_id: region_id,
activeTF: newActiveTF
is_active: newIsActive
}

$scope.sessionService.authenticatedPost(url, postParams,
(data)=>{
//alert(region_id + ' active flag changed to ' + newActiveTF + '!');
//alert(region_id + ' active flag changed to ' + newIsActive + '!');
// TODO refresh the scope
updateRegions();
$scope.regionService.updateRegionDropdown();
Expand Down
4 changes: 2 additions & 2 deletions webapp/app/tools/admin_functions/views/admin_functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ <h4>Activation</h4>
{{r.display_name}}
</td>
<td>
{{r.activeTF}}
{{r.is_active}}
</td>
<td>
<form ng-submit='changeRegionActiveTF(r)'>
<form ng-submit='changeRegionIsActive(r)'>
<input type='submit' class='btn btn-success' value='change'>
</form>
</td>
Expand Down