Drop unnecessary requires_payment() checks
The GraphQL server already checks for this.
This commit is contained in:
parent
054233a7d2
commit
1020e00501
|
@ -6,7 +6,6 @@ from srht.flask import csrf_bypass
|
|||
from srht.graphql import exec_gql
|
||||
from srht.validation import Validation
|
||||
from srht.oauth import oauth, current_token
|
||||
from buildsrht.runner import requires_payment
|
||||
from buildsrht.types import Artifact, Job, JobStatus, Task, JobGroup
|
||||
from buildsrht.types import Visibility, Trigger, TriggerType, TriggerCondition
|
||||
from buildsrht.manifest import Manifest
|
||||
|
@ -29,12 +28,6 @@ def jobs_GET():
|
|||
@oauth("jobs:write")
|
||||
def jobs_POST():
|
||||
valid = Validation(request)
|
||||
if requires_payment(current_token.user):
|
||||
valid.error("Payment is required to submit build jobs. " +
|
||||
"Set up billing at https://meta.sr.ht/billing/initial",
|
||||
status=402)
|
||||
return valid.response
|
||||
|
||||
_manifest = valid.require("manifest", cls=str)
|
||||
max_len = Job.manifest.prop.columns[0].type.length
|
||||
valid.expect(not _manifest or len(_manifest) < max_len,
|
||||
|
|
|
@ -263,9 +263,6 @@ def submit_POST():
|
|||
"Manifest must be less than {} bytes".format(max_len),
|
||||
field="manifest")
|
||||
visibility = valid.require("visibility")
|
||||
payment_required = requires_payment(current_user)
|
||||
valid.expect(not payment_required,
|
||||
"A paid account is required to submit new jobs")
|
||||
if not valid.ok:
|
||||
return render_template("submit.html", **valid.kwargs)
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue