[aur-dev] [PATCH 3/4] git-serve: Drop direct AccountType checking, use AUR_PRIVILEGED
Johannes Löthberg
johannes at kyriasis.com
Tue Jun 23 08:22:39 UTC 2015
On 23/06, Lukas Fleischer wrote:
>On Tue, 23 Jun 2015 at 00:00:20, Johannes Löthberg wrote:
>> Signed-off-by: Johannes Löthberg <johannes at kyriasis.com>
>> ---
>> git-interface/git-serve.py | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/git-interface/git-serve.py b/git-interface/git-serve.py
>> index 6f521cc..2083560 100755
>> --- a/git-interface/git-serve.py
>> +++ b/git-interface/git-serve.py
>> @@ -86,8 +86,8 @@ def check_permissions(pkgbase, user):
>> unix_socket=aur_db_socket, buffered=True)
>> cur = db.cursor()
>>
>> - cur.execute("SELECT AccountTypeID FROM Users WHERE UserName = %s ", [user])
>> - if cur.fetchone()[0] > 1:
>> + privileged = os.environ.get('AUR_PRIVILEGED', False)
>> + if privileged:
>
>I think this is readable enough as a one-liner (without the extra
>variable).
>
Indeed, didn't think about it.
--
Sincerely,
Johannes Löthberg
PGP Key ID: 0x50FB9B273A9D0BB5
https://theos.kyriasis.com/~kyrias/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1495 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/aur-dev/attachments/20150623/b5d3eb67/attachment-0001.asc>
More information about the aur-dev
mailing list