﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30881	Optimize  _tx_resource_for_name() function in  django/scripts/manage_translations.py	ankit1219	nobody	"The **_tx_resource_for_name()** function in **django/scripts/manage_translations.py** uses simple if else statement to return the **Transifex resource name**.

''def _tx_resource_for_name(name):
    """""" Return the Transifex resource name """"""
    if name == 'core':
        return ""django.core""
    else:
        return ""django.contrib-%s"" % name''

You can use Python ternary operator to  reduce code size and increase readability of the code.


''def _tx_resource_for_name(name):
    """""" Return the Transifex resource name """"""
       return ""django.core"" if name == 'core' else ""django.contrib-%s"" % name''

It allows us to replace simple if statements with a single line expression. Increases code readability by reducing number of lines of code.


"	Cleanup/optimization	closed	Core (Other)	3.0	Normal	duplicate	Optimize scripts	asrokx917@…	Unreviewed	1	0	0	0	1	0
