Skip to content

Commit a9cb72c

Browse files
author
Martin J. Laubach
committed
Run project througn sonar, fix a couple of minor issues:
Variable names shadowing builtins, wrong param name for class method, duplicated css rules, accessibility
1 parent 99df027 commit a9cb72c

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

feincms/content/application/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def _update_response_headers(self, request, response, headers):
441441
)
442442

443443
@classmethod
444-
def app_reverse_cache_key(self, urlconf_path, **kwargs):
444+
def app_reverse_cache_key(cls, urlconf_path, **kwargs):
445445
return "FEINCMS:{}:APPCONTENT:{}:{}".format(
446446
getattr(settings, "SITE_ID", 0),
447447
get_language(),

feincms/content/image/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ def render(self, **kwargs):
6767
return AutoRenderTuple((templates, {"content": self}))
6868

6969
def get_image(self):
70-
type, separator, size = getattr(self, "format", "").partition(":")
70+
img_type, _, size = getattr(self, "format", "").partition(":")
7171
if not size:
7272
return self.image
7373

7474
thumbnailer = {"cropscale": feincms_thumbnail.CropscaleThumbnailer}.get(
75-
type, feincms_thumbnail.Thumbnailer
75+
img_type, feincms_thumbnail.Thumbnailer
7676
)
7777
return thumbnailer(self.image, size)
7878

feincms/extensions/ct_tracker.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# ------------------------------------------------------------------------
2-
# ------------------------------------------------------------------------
32
#
43
# ct_tracker.py
54
# FeinCMS
@@ -82,18 +81,18 @@ def _translation_map(self):
8281
# done late as opposed to at class definition time as not all
8382
# information is ready, especially when we are doing a "syncdb" the
8483
# ContentType table does not yet exist
85-
map = {}
84+
tmap = {}
8685
model_to_contenttype = ContentType.objects.get_for_models(
8786
*self.item._feincms_content_types
8887
)
8988
for idx, fct in enumerate(self.item._feincms_content_types):
9089
dct = model_to_contenttype[fct]
9190

9291
# Rely on non-negative primary keys
93-
map[-dct.id] = idx # From-inventory map
94-
map[idx] = dct.id # To-inventory map
92+
tmap[-dct.id] = idx # From-inventory map
93+
tmap[idx] = dct.id # To-inventory map
9594

96-
_translation_map_cache[cls] = map
95+
_translation_map_cache[cls] = tmap
9796
return _translation_map_cache[cls]
9897

9998
def _from_inventory(self, inventory):
@@ -102,10 +101,10 @@ def _from_inventory(self, inventory):
102101
ContentProxy counts format.
103102
"""
104103

105-
map = self._translation_map()
104+
tmap = self._translation_map()
106105

107106
return {
108-
region: [(pk, map[-ct]) for pk, ct in items]
107+
region: [(pk, tmap[-ct]) for pk, ct in items]
109108
for region, items in inventory.items()
110109
if region != "_version_"
111110
}

feincms/static/feincms/item_editor.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,13 @@ textarea {
133133

134134
.machine-control {
135135
padding: 5px 10px 5px 10px;
136-
border: 1px solid #ccc;
137-
background-color: #edf3fe;
136+
border: 1px solid #eee;
137+
background-color: #f8f8f8;
138138
position: absolute;
139139
left: -11px;
140140
bottom: -30px;
141141
width: 100%;
142142

143-
background: #f8f8f8;
144-
border: 1px solid #eee;
145143
height: 55px;
146144
}
147145

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<iframe src="//player.vimeo.com/video/{{ id }}" width="650" height="365"
1+
<iframe src="//player.vimeo.com/video/{{ id }}" title="Video Player" width="650" height="365"
22
frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>

0 commit comments

Comments
 (0)