On 26/03/2015 17:21, CrÃstian Viana wrote:
On 26-03-2015 16:55, Aline Manera wrote:
> We can use '' (empty string) as the default value while getting the
> information from the data sent and simplify that code in a similar
> way we did on addRepo()
When adding a new repository, it doesn't matter if the user didn't
specify one of those fields or if they specified an empty string; it's
all "empty", and we always convert the empty value to an empty string
when adding a new repo.
However, when editing an existing repository, which is the case you
mentioned here, there _is_ a difference between not specifying a value
(i.e. the user doesn't want to change it) and specifying an empty
string (i.e. the user wants to clear that field). That's why we need
to handle a value which wasn't specified as None, and not as an empty
string.
Actually, I just followed along the existing code regarding base URL
and mirror list, which uses None as the default (i.e. non-incoming)
value, but I guess that is the real reason it was implemented like that.
Agree. I haven't thought about that case.
Keep doing it as it is now. But remember we can not have mirrorlist
*and* metalink - it is one or other.