Skip to content

Commit

Permalink
[refactor] Reformatted the code
Browse files Browse the repository at this point in the history
  • Loading branch information
devkapilbansal committed Nov 15, 2020
1 parent 88d6539 commit 60b0521
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion django_loci/channels/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
)
]
)
),
)
)
}
)
10 changes: 4 additions & 6 deletions django_loci/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ class Migration(migrations.Migration):

initial = True

dependencies = [
('contenttypes', '0002_remove_content_type_name'),
]
dependencies = [('contenttypes', '0002_remove_content_type_name')]

operations = [
migrations.CreateModel(
Expand Down Expand Up @@ -137,7 +135,7 @@ class Migration(migrations.Migration):
),
),
],
options={'abstract': False,},
options={'abstract': False},
),
migrations.CreateModel(
name='ObjectLocation',
Expand Down Expand Up @@ -212,9 +210,9 @@ class Migration(migrations.Migration):
),
),
migrations.AlterUniqueTogether(
name='objectlocation', unique_together=set([('content_type', 'object_id')]),
name='objectlocation', unique_together=set([('content_type', 'object_id')])
),
migrations.AlterUniqueTogether(
name='floorplan', unique_together=set([('location', 'floor')]),
name='floorplan', unique_together=set([('location', 'floor')])
),
]
4 changes: 2 additions & 2 deletions django_loci/tests/testdeviceapp/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ class Migration(migrations.Migration):
),
('name', models.CharField(max_length=75, verbose_name='name')),
],
options={'abstract': False,},
),
options={'abstract': False},
)
]
6 changes: 2 additions & 4 deletions django_loci/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ def get_context(self, name, value, attrs):
c = super().get_context(name, value, attrs)
if value and hasattr(value, 'url'):
c.update(
{'filename': value.name, 'url': value.url, 'thumbnail': self.thumbnail,}
{'filename': value.name, 'url': value.url, 'thumbnail': self.thumbnail}
)
try:
c.update(
{'width': value.width, 'height': value.height,}
)
c.update({'width': value.width, 'height': value.height})
except IOError:
msg = 'floorplan image not found while showing floorplan:\n{0}'
logger.error(msg.format(value.name))
Expand Down
4 changes: 1 addition & 3 deletions tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@
ROOT_URLCONF = 'urls'

ASGI_APPLICATION = "django_loci.channels.routing.channel_routing"
CHANNEL_LAYERS = {
"default": {"BACKEND": "channels.layers.InMemoryChannelLayer"},
}
CHANNEL_LAYERS = {"default": {"BACKEND": "channels.layers.InMemoryChannelLayer"}}

TIME_ZONE = 'Europe/Rome'
LANGUAGE_CODE = 'en-gb'
Expand Down
4 changes: 1 addition & 3 deletions tests/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns = [
url(r'^admin/', admin.site.urls),
]
urlpatterns = [url(r'^admin/', admin.site.urls)]

urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Expand Down

0 comments on commit 60b0521

Please sign in to comment.