Code review comment for lp:~jcsackett/launchpad/deprecate-official_codehosting

Revision history for this message
Brad Crittenden (bac) wrote :

This branch looks nice Jon. What would you think of creating some helper functions like:

uses_Launchpad(thing)

You could then collapse this:

175 + if self.codehosting_usage == ServiceUsage.LAUNCHPAD:
176 + configured = True
177 + else:
178 + configured = False
179 return [dict(link=set_branch,
181 + configured=configured)]

to:

179 return [dict(link=set_branch,
181 + configured=uses_launchpad(self.codehosting_usage)

I guess you could do the same with:

configured = (self.codehosting_usage == ServiceUsage.LAUNCHPAD)

with less overhead.

review: Approve (code)

« Back to merge proposal