-
Notifications
You must be signed in to change notification settings - Fork 14
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
Refactor "Site Manager" to "Forest Steward" to match business design #277
Merged
Samuel-Therrien-Beslogic
merged 2 commits into
main
from
refactor/238-Change-SiteManager-role-name-to-ForestSteward
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
|
@@ -27,6 +27,7 @@ | |
Mulchlayertype, | ||
Post, | ||
Role, | ||
RoleName, | ||
Site, | ||
Siteadmin, | ||
Sitetreespecies, | ||
|
@@ -456,9 +457,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 +467,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, | ||
), | ||
), | ||
] |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the other project should we just consider redoing the db and handle migration later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've been squashing the migrations and nuking the DB out of lazyness/simplicity when it would require doing a manual migration script.
These should work just fine as is