Skip to content
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

Revert "fix: unit test folder name used checking" (CA-137) #13

Merged
merged 1 commit into from
Oct 18, 2023
Merged
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
11 changes: 1 addition & 10 deletions core/base_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,7 @@ class Meta:

def __str__(self) -> str:
return self.name

def clean(self) -> None:
scope = self.get_scope()
field_errors = {}
_fields_to_check = self.fields_to_check if hasattr(self, 'fields_to_check') else ['name']
if not self.is_unique_in_scope(scope=scope, fields_to_check=_fields_to_check):
field_errors['name'] = _('This name is already in use.')
super().clean()
if field_errors:
raise ValidationError(field_errors)


class AbstractBaseModel(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
Expand Down
17 changes: 0 additions & 17 deletions core/migrations/0018_alter_evidence_options.py

This file was deleted.

2 changes: 1 addition & 1 deletion iam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _get_root_folder():
return None


class Folder(I18nMixin, NameDescriptionMixin, AbstractBaseModel):
class Folder(AbstractBaseModel, I18nMixin, NameDescriptionMixin):
""" A folder is a container for other folders or any object
Folders are organized in a tree structure, with a single root folder
Folders are the base perimeter for role assignments
Expand Down
Loading