-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/BesLogic/releaf-canopeum in…
…to bugfix/proper-use-of-theme-colors
- Loading branch information
Showing
51 changed files
with
448 additions
and
405 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
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
Mulchlayertype, | ||
Post, | ||
Role, | ||
RoleName, | ||
Site, | ||
Siteadmin, | ||
Sitetreespecies, | ||
|
@@ -305,7 +306,6 @@ def create_batches_for_site(site): | |
soil_condition="Good", | ||
survived_count=survived_count, | ||
replace_count=replace_count, | ||
total_number_seed=number_of_seed, | ||
total_propagation=random.randint(0, number_of_seed), | ||
) | ||
create_batch_species_for_batch(batch) | ||
|
@@ -423,7 +423,7 @@ def create_tree_types(self): | |
) | ||
|
||
def create_site_types(self): | ||
# This mapping MUST MATCH pinMap in canopeum_frontend/src/pages/Map.tsx | ||
# This mapping MUST MATCH pinMap in canopeum_frontend/src/models/SiteType.ts | ||
site_type_names = { | ||
1: ("Canopeum", "Canopeum"), | ||
2: ("Parks", "Parcs"), | ||
|
@@ -456,9 +456,8 @@ def create_assets(self): | |
asset.asset.save(file_name, django_file, save=True) | ||
|
||
def create_roles(self): | ||
Role.objects.create(name="User") | ||
Role.objects.create(name="SiteManager") | ||
Role.objects.create(name="MegaAdmin") | ||
for role in RoleName: | ||
Role.objects.create(name=role) | ||
|
||
def create_users(self): | ||
User.objects.create_user( | ||
|
@@ -467,37 +466,37 @@ def create_users(self): | |
password="Adminbeslogic!", # noqa: S106 # MOCK_PASSWORD | ||
is_staff=True, | ||
is_superuser=True, | ||
role=Role.objects.get(name="MegaAdmin"), | ||
role=Role.objects.get(name=RoleName.MegaAdmin), | ||
) | ||
User.objects.create_user( | ||
username="TyrionLannister", | ||
email="[email protected]", | ||
password="tyrion123", # noqa: S106 # MOCK_PASSWORD | ||
role=Role.objects.get(name="SiteManager"), | ||
role=Role.objects.get(name=RoleName.ForestSteward), | ||
) | ||
User.objects.create_user( | ||
username="DaenerysTargaryen", | ||
email="[email protected]", | ||
password="daenerys123", # noqa: S106 # MOCK_PASSWORD | ||
role=Role.objects.get(name="SiteManager"), | ||
role=Role.objects.get(name=RoleName.ForestSteward), | ||
) | ||
User.objects.create_user( | ||
username="JonSnow", | ||
email="[email protected]", | ||
password="jon123", # noqa: S106 # MOCK_PASSWORD | ||
role=Role.objects.get(name="SiteManager"), | ||
role=Role.objects.get(name=RoleName.ForestSteward), | ||
) | ||
User.objects.create_user( | ||
username="OberynMartell", | ||
email="[email protected]", | ||
password="oberyn123", # noqa: S106 # MOCK_PASSWORD | ||
role=Role.objects.get(name="SiteManager"), | ||
role=Role.objects.get(name=RoleName.ForestSteward), | ||
) | ||
User.objects.create_user( | ||
username="NormalUser", | ||
email="[email protected]", | ||
password="normal123", # noqa: S106 # MOCK_PASSWORD | ||
role=Role.objects.get(name="User"), | ||
role=Role.objects.get(name=RoleName.User), | ||
) | ||
|
||
def create_sites(self): | ||
|
25 changes: 25 additions & 0 deletions
25
canopeum_backend/canopeum_backend/migrations/0002_alter_role_name.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,25 @@ | ||
# Generated by Django 5.1 on 2024-10-29 21:39 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("canopeum_backend", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="role", | ||
name="name", | ||
field=models.CharField( | ||
choices=[ | ||
("User", "User"), | ||
("ForestSteward", "Foreststeward"), | ||
("MegaAdmin", "Megaadmin"), | ||
], | ||
max_length=13, | ||
), | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
canopeum_backend/canopeum_backend/migrations/0002_remove_batch_total_number_seed.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,17 @@ | ||
# Generated by Django 5.1 on 2024-10-29 19:34 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("canopeum_backend", "0001_initial"), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name="batch", | ||
name="total_number_seed", | ||
), | ||
] |
13 changes: 13 additions & 0 deletions
13
canopeum_backend/canopeum_backend/migrations/0003_merge_20241114_1218.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,13 @@ | ||
# Generated by Django 5.1 on 2024-11-14 17:18 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("canopeum_backend", "0002_alter_role_name"), | ||
("canopeum_backend", "0002_remove_batch_total_number_seed"), | ||
] | ||
|
||
operations = [] |
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.