-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Attempting to add mysql + postgres to Dockerfile for production and still work with testing * Attempting to add mysql + postgres to Dockerfile for production and still work with testing * v0.2.1 * Run postgres no matter what unless you specify not to * Run postgres no matter what unless you specify not to * Updated poetry lock * Updated sqlmode for prod too * Ran black formatter * Added support for AWS S3 * Ran black formatter * Added feature flags via AWS AppConfig * Cleaned up feature flags * Ready for 0.2.1-alpha.6 * Revert "Ready for 0.2.1-alpha.6" This reverts commit 4fa6f45. * Ready for 0.2.1-alpha.6 * Ran black formatter * Ready for FeatureFlags + More testing * Ran formatter * Adding debug statements * Adding feature flags (AWS AppConfig / Cache) * Changed the buttons to be "Dashboard" if logged in, rather than "login" and "register" * Added user roles (USER/DEV/TESTER/STAFF) * Ran formatters * v0.2.1 * Minor cleanup
- Loading branch information
Showing
23 changed files
with
30,930 additions
and
343 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
43 changes: 43 additions & 0 deletions
43
backend/migrations/0016_alter_invoice_logo_alter_receipt_image_and_more.py
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,43 @@ | ||
# Generated by Django 5.0.2 on 2024-02-14 19:26 | ||
|
||
from django.db import migrations, models | ||
|
||
import settings.settings | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("backend", "0015_alter_notification_user_alter_team_name"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="invoice", | ||
name="logo", | ||
field=models.ImageField( | ||
blank=True, | ||
null=True, | ||
storage=settings.settings.CustomPrivateMediaStorage(), | ||
upload_to="invoice_logos", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="receipt", | ||
name="image", | ||
field=models.ImageField( | ||
storage=settings.settings.CustomPrivateMediaStorage(), | ||
upload_to="receipts", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="usersettings", | ||
name="profile_picture", | ||
field=models.ImageField( | ||
blank=True, | ||
null=True, | ||
storage=settings.settings.CustomPublicMediaStorage(), | ||
upload_to="profile_pictures/", | ||
), | ||
), | ||
] |
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,30 @@ | ||
# Generated by Django 5.0.2 on 2024-02-18 20:17 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("backend", "0016_alter_invoice_logo_alter_receipt_image_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="FeatureFlags", | ||
fields=[ | ||
( | ||
"id", | ||
models.BigAutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("name", models.CharField(max_length=100)), | ||
("value", models.BooleanField(default=False)), | ||
("updated_at", models.DateTimeField(auto_now=True)), | ||
], | ||
), | ||
] |
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,27 @@ | ||
# Generated by Django 5.0.1 on 2024-02-20 10:18 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("backend", "0017_featureflags"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="user", | ||
name="role", | ||
field=models.CharField( | ||
choices=[ | ||
("DEV", "Developer"), | ||
("STAFF", "Staff"), | ||
("USER", "User"), | ||
("TESTER", "Tester"), | ||
], | ||
default="USER", | ||
max_length=10, | ||
), | ||
), | ||
] |
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 |
---|---|---|
@@ -1 +1,20 @@ | ||
from django.core.cache import cache | ||
from django.core.cache.backends.redis import RedisCacheClient | ||
|
||
cache: RedisCacheClient = cache | ||
|
||
from backend.models import FeatureFlags | ||
|
||
|
||
def get_feature_status(feature): | ||
key = f"myfinances:feature_flag:{feature}" | ||
cached_value = cache.get(key) | ||
if cached_value: | ||
return cached_value | ||
|
||
value = FeatureFlags.objects.filter(name=feature).first() | ||
if value: | ||
cache.set(key, value.value, timeout=300) | ||
return value.value | ||
else: | ||
return False |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from django.core.cache import cache | ||
from django.http import HttpRequest | ||
from django.shortcuts import render | ||
|
||
|
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.