Skip to content

Commit

Permalink
🎨 [#315] Trying with new version of black
Browse files Browse the repository at this point in the history
  • Loading branch information
ErhanCitil committed May 31, 2023
1 parent 8a86f09 commit 2dee5e3
Show file tree
Hide file tree
Showing 45 changed files with 47 additions and 59 deletions.
1 change: 0 additions & 1 deletion src/objects/accounts/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
1 change: 0 additions & 1 deletion src/objects/accounts/migrations/0002_auto_20201012_1522.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("accounts", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/accounts/migrations/0003_auto_20201223_1231.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("accounts", "0002_auto_20201012_1522"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/api/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ def __call__(self, attrs):
try:
response = client.retrieve("objecttype", url=object_type.url)
except ClientError as exc:

msg = f"Object type can not be retrieved: {exc.args[0]}"
raise ValidationError(msg)

Expand Down
3 changes: 2 additions & 1 deletion src/objects/core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ class ObjectTypeAdmin(admin.ModelAdmin):

def get_version(self, obj):
return ObjectRecord.objects.filter(object__object_type=obj).count()

get_version.short_description = "version"


class ObjectRecordInline(admin.TabularInline):
model = ObjectRecord
extra = 1
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0002_auto_20200518_1707.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0001_initial"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0003_objectrecord.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0002_auto_20200518_1707"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0004_move_data_to_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def move_data_from_record(apps, _):


class Migration(migrations.Migration):

dependencies = [
("core", "0003_objectrecord"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0005_remove_object_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0004_move_data_to_record"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0006_auto_20200904_1402.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0005_remove_object_data"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0007_auto_20200904_1403.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0006_auto_20200904_1402"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0008_objectrecord_correct.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0007_auto_20200904_1403"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0009_objectrecord_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0008_objectrecord_correct"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0010_move_version_to_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ def move_version_from_record(apps, _):


class Migration(migrations.Migration):

dependencies = [
("core", "0009_objectrecord_version"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0011_remove_object_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0010_move_version_to_record"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0012_objectrecord_uuid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0011_remove_object_version"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0013_generate_record_uuids.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def generate_record_uuids(apps, _):


class Migration(migrations.Migration):

dependencies = [
("core", "0012_objectrecord_uuid"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0014_auto_20200915_1740.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0013_generate_record_uuids"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0015_objectrecord_geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0014_auto_20200915_1740"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0016_auto_20210111_1649.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0015_objectrecord_geometry"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0017_auto_20210111_1653.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0016_auto_20210111_1649"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0018_auto_20210113_1239.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0017_auto_20210111_1653"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0019_fill_record_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def fill_record_index(apps, _):


class Migration(migrations.Migration):

dependencies = [
("core", "0018_auto_20210113_1239"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0020_auto_20210118_1117.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0019_fill_record_index"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0021_auto_20201222_1745.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("zgw_consumers", "0011_remove_service_extra"),
("core", "0020_auto_20210118_1117"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def move_objecttypes_from_model(apps, _):


class Migration(migrations.Migration):

dependencies = [
("core", "0021_auto_20201222_1745"),
("zgw_consumers", "0011_remove_service_extra"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0022_move_object_types_to_separate_model"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0024_auto_20201222_1811.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0023_remove_object_object_type"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def remove_objects_with_empty_object_type(apps, _):


class Migration(migrations.Migration):

dependencies = [
("core", "0024_auto_20201222_1811"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0026_auto_20201222_1833.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0025_delete_objects_with_empty_object_type"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/migrations/0027_auto_20211203_1209.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0026_auto_20201222_1833"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def check_objecttype(object_type, version, data):
try:
response = client.retrieve("objectversion", url=objecttype_version_url)
except ClientError as exc:

msg = f"Object type version can not be retrieved: {exc.args[0]}"
raise ValidationError(msg)

Expand Down
29 changes: 22 additions & 7 deletions src/objects/token/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,24 @@

@admin.register(Permission)
class PermissionAdmin(admin.ModelAdmin):
list_display = ("token_auth", "object_type", "get_object_type_uuid", "get_object_record_version", "mode", "use_fields")
list_display = (
"token_auth",
"object_type",
"get_object_type_uuid",
"get_object_record_version",
"mode",
"use_fields",
)

def get_object_type_uuid(self, obj):
return obj.object_type.uuid

def get_object_record_version(self, obj):
return ObjectRecord.objects.filter(object__object_type=obj.object_type).count()

get_object_record_version.short_description = "version"
get_object_type_uuid.short_description = "UUID"

def get_object_fields(self):
object_serializer = ObjectSerializer()
object_fields = build_spec(get_field_names(object_serializer.fields), ui=True)
Expand Down Expand Up @@ -113,17 +120,25 @@ def add_view(self, request, form_url="", extra_context=None):
class PermissionInline(EditInlineAdminMixin, admin.TabularInline):
model = Permission
fk_name = "token_auth"
fields = ("object_type", "get_object_type_uuid", "get_object_record_version", "mode", "use_fields", "fields")
fields = (
"object_type",
"get_object_type_uuid",
"get_object_record_version",
"mode",
"use_fields",
"fields",
)

def get_object_type_uuid(self, obj):
return obj.object_type.uuid

def get_object_record_version(self, obj):
return ObjectRecord.objects.filter(object__object_type=obj.object_type).count()

get_object_record_version.short_description = "version"
get_object_type_uuid.short_description = "UUID"


@admin.register(TokenAuth)
class TokenAuthAdmin(admin.ModelAdmin):
list_display = (
Expand Down
1 change: 0 additions & 1 deletion src/objects/token/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = []
Expand Down
1 change: 0 additions & 1 deletion src/objects/token/migrations/0002_auto_20201223_1231.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0026_auto_20201222_1833"),
("token", "0001_initial"),
Expand Down
1 change: 0 additions & 1 deletion src/objects/token/migrations/0003_auto_20210312_1507.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("token", "0002_auto_20201223_1231"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/token/migrations/0004_auto_20210315_1537.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("token", "0003_auto_20210312_1507"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/token/migrations/0005_auto_20210623_1242.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("token", "0004_auto_20210315_1537"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/token/migrations/0006_auto_20210721_1543.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("core", "0026_auto_20201222_1833"),
("token", "0005_auto_20210623_1242"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class Migration(migrations.Migration):

dependencies = [
("token", "0006_auto_20210721_1543"),
]
Expand Down
1 change: 0 additions & 1 deletion src/objects/token/migrations/0008_permission_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class Migration(migrations.Migration):

dependencies = [
("token", "0007_remove_permission_fields"),
]
Expand Down
Loading

0 comments on commit 2dee5e3

Please sign in to comment.