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

fix uniweb-issue-1353: attempt to remove missing item from list #439

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
2 changes: 1 addition & 1 deletion djangocms_versioning/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ def compare_versions(self, request, queryset):
f"admin:{self.model._meta.app_label}_{self.model._meta.model_name}_compare",
args=(queryset[0].pk,),
)
url += "?compare_to=%d" % queryset[1].pk
url += f"?compare_to={queryset[1].pk}"

return redirect(url)

Expand Down
2 changes: 1 addition & 1 deletion djangocms_versioning/cms_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def get_readonly_fields(self, request, obj=None):
if form.fieldsets:
fields = flatten_fieldsets(form.fieldsets)
fields = list(fields)
for f_name in ["slug", "overwrite_url"]:
for f_name in {"slug", "overwrite_url"}.intersection(fields):
fields.remove(f_name)
return fields

Expand Down
2 changes: 1 addition & 1 deletion djangocms_versioning/test_utils/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def version(self, create, extracted, **kwargs):
class AnswerFactory(factory.django.DjangoModelFactory):
poll_content = factory.SubFactory(PollContentFactory)
text = factory.LazyAttributeSequence(
lambda o, n: "Poll %s - Answer %d" % (o.poll_content.poll.name, n)
lambda o, n: f"Poll {o.poll_content.poll.name} - Answer {n}"
)

class Meta:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2156,7 +2156,7 @@ def test_compare_view_has_version_data_in_context_when_version2_in_get_param(sel
url = self.get_admin_url(
self.versionable.version_model_proxy, "compare", versions[0].pk
)
url += "?compare_to=%d" % versions[1].pk
url += f"?compare_to={versions[1].pk}"
user = self.get_staff_user_with_no_permissions()

with self.login_user_context(user):
Expand Down
Loading