-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'staging' into 'master'
Release v2.2.0 See merge request bullet-train/bullet-train-api!132
- Loading branch information
Showing
37 changed files
with
1,181 additions
and
625 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ checkstyle.txt | |
.env | ||
.direnv | ||
.envrc | ||
.elasticbeanstalk/ |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,19 @@ | ||
from rest_framework import serializers | ||
|
||
from features.utils import INTEGER, BOOLEAN, STRING | ||
|
||
|
||
class FeatureSegmentValueField(serializers.Field): | ||
def to_internal_value(self, data): | ||
if data is not None: | ||
# grab the type of the value and set the context for use | ||
# in the create / update methods on the serializer | ||
value_type = type(data).__name__ | ||
value_types = [STRING, BOOLEAN, INTEGER] | ||
value_type = value_type if value_type in value_types else STRING | ||
self.context['value_type'] = value_type | ||
|
||
return str(data) | ||
|
||
def to_representation(self, value): | ||
return self.root.instance.get_value() |
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,13 @@ | ||
import typing | ||
|
||
from features.utils import INTEGER, BOOLEAN | ||
|
||
|
||
def get_correctly_typed_value(value_type: str, string_value: str) -> typing.Any: | ||
if value_type == INTEGER: | ||
return int(string_value) | ||
elif value_type == BOOLEAN: | ||
return string_value == 'True' | ||
|
||
return string_value | ||
|
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,25 @@ | ||
# Generated by Django 2.2.12 on 2020-06-07 10:05 | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('environments', '0012_auto_20200504_1322'), | ||
('segments', '0007_auto_20190906_1416'), | ||
('features', '0016_auto_20190916_1717'), | ||
] | ||
|
||
operations = [ | ||
# first, add the field, allowing null values | ||
migrations.AddField( | ||
model_name='featuresegment', | ||
name='environment', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='feature_segments', to='environments.Environment'), | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='featuresegment', | ||
unique_together={('feature', 'environment', 'segment')}, | ||
), | ||
] |
Oops, something went wrong.